You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let serve_connection = serve_connection(socket, local_addr, remote_addr, scheme, ep, server_graceful_shutdown_token.clone(), idle_timeout);
if timeout.is_some(){
tokio::select! {
_ = serve_connection => {}
_ = timeout_token.cancelled() => {}
}
} else {
serve_connection.await;
}
if alive_connections.fetch_sub(1, Ordering::Acquire) == 1{
// notify only if shutdown is initiated, to prevent notification when server is active.
// It's a valid state to have 0 alive connections when server is not shutting down.
if server_graceful_shutdown_token.is_cancelled(){
notify.notify_one();
}
}
});
}
}
}
}
drop(acceptor);
if alive_connections.load(Ordering::Acquire) > 0{
tracing::info!(name = name, "wait for all connections to close.");
notify.notified().await;
}
We have a situation that serve_connection.await panic and thus alive_connections.fetch_sub doesn't execute, so that outer notify.notified().await blocks forever.
We should either handle panic, or do a timeout for waiting connections to close.
The text was updated successfully, but these errors were encountered:
poem/poem/src/server.rs
Lines 168 to 197 in c66d78a
We have a situation that
serve_connection.await
panic and thusalive_connections.fetch_sub
doesn't execute, so that outernotify.notified().await
blocks forever.We should either handle panic, or do a timeout for waiting connections to close.
The text was updated successfully, but these errors were encountered: