Skip to content

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
bmwill committed Jul 25, 2024
1 parent c626117 commit 7c4c770
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 10 deletions.
5 changes: 1 addition & 4 deletions consensus/core/src/network/tonic_network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -895,13 +895,10 @@ impl<S: NetworkService> NetworkManager<S> for TonicManager {
},
_ = shutdown_notif.wait(), if !has_shutdown => {
trace!("Received shutdown. Stopping connection for {peer_addr:?}");
connection.as_mut().graceful_shutdown();
has_shutdown = true;
},
}

if has_shutdown {
break;
}
}

Ok(())
Expand Down
1 change: 1 addition & 0 deletions crates/sui-proxy/src/histogram_relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ pub fn start_prometheus_server(listener: TcpListener) -> HistogramRelay {
);

tokio::spawn(async move {
listener.set_nonblocking(true).unwrap();
let listener = tokio::net::TcpListener::from_std(listener).unwrap();
axum::serve(listener, app).await.unwrap();
});
Expand Down
1 change: 1 addition & 0 deletions crates/sui-proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ mod tests {
let app = Router::new().route("/v1/push", post(handler));

// run it
listener.set_nonblocking(true).unwrap();
let listener = tokio::net::TcpListener::from_std(listener).unwrap();
axum::serve(listener, app).await.unwrap();
}
Expand Down
1 change: 1 addition & 0 deletions crates/sui-proxy/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub fn start_prometheus_server(listener: TcpListener) -> RegistryService {
);

tokio::spawn(async move {
listener.set_nonblocking(true).unwrap();
let listener = tokio::net::TcpListener::from_std(listener).unwrap();
axum::serve(listener, app).await.unwrap();
});
Expand Down
2 changes: 2 additions & 0 deletions crates/sui-source-validation-service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ pub async fn serve(app_state: Arc<RwLock<AppState>>) -> anyhow::Result<()> {
)
.with_state(app_state);
let listener = TcpListener::bind(host_port())?;
listener.set_nonblocking(true).unwrap();
let listener = tokio::net::TcpListener::from_std(listener)?;
axum::serve(listener, app).await?;
Ok(())
Expand Down Expand Up @@ -608,6 +609,7 @@ pub fn start_prometheus_server(listener: TcpListener) -> RegistryService {
.layer(Extension(registry_service.clone()));

tokio::spawn(async move {
listener.set_nonblocking(true).unwrap();
let listener = tokio::net::TcpListener::from_std(listener).unwrap();
axum::serve(listener, app).await.unwrap();
});
Expand Down
7 changes: 1 addition & 6 deletions narwhal/primary/tests/nodes_bootstrapping_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,7 @@ async fn test_response_error_after_shutdown_internal_consensus() {
let Err(e) = client.submit_transaction(txn).await else {
panic!("Submitting transactions after Narwhal shutdown should fail!");
};
assert!(
e.message()
.contains("error trying to connect: tcp connect error:"),
"Actual: {}",
e
);
assert!(e.message().contains("tcp connect error:"), "Actual: {}", e);
}

/// Nodes will be started in a staggered fashion. This is simulating
Expand Down

0 comments on commit 7c4c770

Please sign in to comment.