[ty] Fix server hang after shutdown request (#18414)

This commit is contained in:
Micha Reiser 2025-06-02 08:57:51 +02:00 committed by GitHub
parent 844c8626c3
commit 1e6d76c878
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 176 additions and 158 deletions

View file

@ -37,10 +37,18 @@ pub fn run_server() -> anyhow::Result<()> {
let io_result = io_threads.join();
match (server_result, io_result) {
let result = match (server_result, io_result) {
(Ok(()), Ok(())) => Ok(()),
(Err(server), Err(io)) => Err(server).context(format!("IO thread error: {io}")),
(Err(server), _) => Err(server),
(_, Err(io)) => Err(io).context("IO thread error"),
};
if let Err(err) = result.as_ref() {
tracing::warn!("Server shut down with an error: {err}");
} else {
tracing::info!("Server shut down");
}
result
}