Skip to content

Commit

Permalink
fix(rust): echo service initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianbenavides committed Feb 5, 2025
1 parent 371f8db commit f3196c1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,21 +278,21 @@ impl NodeManager {
ctx: &Context,
start_default_services: bool,
) -> ockam_core::Result<()> {
if start_default_services {
self.api_sc_listener = Some(
self.initialize_default_services(ctx, &self.api_transport_flow_control_ids)
.await?,
);
}

// Always start the echoer service as ockam_api::Session assumes it will be
// started unconditionally on every node. It's used for liveliness checks.
self.start_echoer_service(ctx, DefaultAddress::ECHO_SERVICE.into())
.await?;
for api_flow_control_id in &self.api_transport_flow_control_ids {
ctx.flow_controls()
.add_consumer(&DefaultAddress::ECHO_SERVICE.into(), api_flow_control_id);
}
self.start_echoer_service(ctx, DefaultAddress::ECHO_SERVICE.into())
.await?;

if start_default_services {
self.api_sc_listener = Some(
self.initialize_default_services(ctx, &self.api_transport_flow_control_ids)
.await?,
);
}

Ok(())
}
Expand Down
2 changes: 2 additions & 0 deletions implementations/rust/ockam/ockam_node/src/router/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ impl InternalMap {
})?
.clone();

debug!(%address, %primary_address, "Stopping address");

self.flow_controls.cleanup_address(&primary_address);

let record = if let Some(record) = records.remove(&primary_address) {
Expand Down
6 changes: 1 addition & 5 deletions implementations/rust/ockam/ockam_node/src/router/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,7 @@ impl Router {

/// Stop the worker
pub fn stop_address(&self, addr: &Address, skip_sending_stop_signal: bool) -> Result<()> {
debug!("Stopping address '{}'", addr);

self.map.stop(addr, skip_sending_stop_signal)?;

Ok(())
self.map.stop(addr, skip_sending_stop_signal)
}

#[cfg(feature = "std")]
Expand Down

0 comments on commit f3196c1

Please sign in to comment.