diff --git a/broker/src/tasks/broker_listener.rs b/broker/src/tasks/broker_listener.rs index 60635e7..762ce11 100644 --- a/broker/src/tasks/broker_listener.rs +++ b/broker/src/tasks/broker_listener.rs @@ -7,7 +7,7 @@ use proto::{ crypto::signature::SignatureScheme, }; use tokio::spawn; -use tracing::warn; +use tracing::error; // TODO: change connection to be named struct instead of tuple for readability purposes use crate::Inner; @@ -32,8 +32,8 @@ impl< let unfinalized_connection = match listener.accept().await { Ok(connection) => connection, Err(err) => { - warn!("failed to accept connection: {}", err); - continue; + error!("failed to accept connection: {}", err); + return; } }; diff --git a/broker/src/tasks/user_listener.rs b/broker/src/tasks/user_listener.rs index 9375a04..34ab87a 100644 --- a/broker/src/tasks/user_listener.rs +++ b/broker/src/tasks/user_listener.rs @@ -7,7 +7,7 @@ use proto::{ crypto::signature::SignatureScheme, }; use tokio::spawn; -use tracing::warn; +use tracing::error; use crate::Inner; @@ -31,8 +31,8 @@ impl< let unfinalized_connection = match listener.accept().await { Ok(connection) => connection, Err(err) => { - warn!("failed to accept connection: {}", err); - continue; + error!("failed to accept connection: {}", err); + return; } }; diff --git a/marshal/src/lib.rs b/marshal/src/lib.rs index b02e0a6..17a6b8b 100644 --- a/marshal/src/lib.rs +++ b/marshal/src/lib.rs @@ -19,7 +19,6 @@ use proto::{ DiscoveryClientType, }; use tokio::spawn; -use tracing::warn; /// The `Marshal's` configuration (with a Builder), to help with usability. /// We need this to construct a `Marshal` @@ -105,13 +104,11 @@ impl Marshal connection, - Err(err) => { - warn!("failed to accept connection: {}", err); - continue; - } - }; + let unfinalized_connection = bail!( + self.listener.accept().await, + Connection, + "failed to accept connection" + ); // Create a task to handle the connection let discovery_client = self.discovery_client.clone(); diff --git a/proto/src/connection/auth/marshal.rs b/proto/src/connection/auth/marshal.rs index 2746076..cd904af 100644 --- a/proto/src/connection/auth/marshal.rs +++ b/proto/src/connection/auth/marshal.rs @@ -104,7 +104,7 @@ impl MarshalAuth