Skip to content

Commit

Permalink
Merge pull request #2 from insight-platform/060-fixes
Browse files Browse the repository at this point in the history
fixed bugs with ipc permissions and listened port
  • Loading branch information
bwsw authored Jun 13, 2024
2 parents bd0fcd1 + ff91be3 commit cc1ab0b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tokio-timerfd = "0.2"
uuid = { version = "1", features = ["v7"] }

[workspace.package]
version = "0.5.0"
version = "0.6.0"
edition = "2021"
authors = ["Ivan Kudriavtsev <ivan.a.kudryavtsev@gmail.com>"]
description = "ReplayDB Service"
Expand Down
7 changes: 4 additions & 3 deletions replay/assets/test.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"common": {
"pass_metadata_only": false,
"management_port": 8080,
"management_port": ${API_PORT:-8080},
"stats_period": {
"secs": 60,
"nanos": 0
Expand All @@ -17,7 +17,7 @@
}
},
"in_stream": {
"url": "router+bind:tcp://0.0.0.0:5555",
"url": "${IN_STREAM:-router+bind:tcp://0.0.0.0:5555}",
"receive_timeout": {
"secs": 1,
"nanos": 0
Expand All @@ -27,7 +27,8 @@
"none": null
},
"source_cache_size": 1000,
"inflight_ops": 100
"inflight_ops": 100,
"fix_ipc_permissions": 511
},
"out_stream": {
"url": "pub+bind:tcp://0.0.0.0:5556",
Expand Down
2 changes: 1 addition & 1 deletion replay/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ async fn main() -> Result<()> {

App::new().service(scope)
})
.bind(("127.0.0.1", port))?
.bind(("0.0.0.0", port))?
.run(),
);

Expand Down
11 changes: 8 additions & 3 deletions replaydb/src/service/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,19 @@ impl TryFrom<&SourceConfiguration> for NonBlockingReader {
fn try_from(
source_conf: &SourceConfiguration,
) -> result::Result<NonBlockingReader, Self::Error> {
let conf = ReaderConfigBuilder::default()
.url(&source_conf.url)?
let conf = ReaderConfigBuilder::default().url(&source_conf.url)?;
let conf = if let Some(fix_ipc_permissions) = source_conf.fix_ipc_permissions {
conf.with_fix_ipc_permissions(Some(fix_ipc_permissions))?
} else {
ReaderConfigBuilder::default().url(&source_conf.url)?
};
let conf = conf
.with_receive_timeout(source_conf.receive_timeout.as_millis() as i32)?
.with_receive_hwm(source_conf.receive_hwm as i32)?
.with_topic_prefix_spec((&source_conf.topic_prefix_spec).into())?
.with_routing_cache_size(source_conf.source_cache_size)?
.with_fix_ipc_permissions(source_conf.fix_ipc_permissions)?
.build()?;

let mut reader = NonBlockingReader::new(&conf, source_conf.inflight_ops)?;
reader.start()?;
Ok(reader)
Expand Down

0 comments on commit cc1ab0b

Please sign in to comment.