Fix/issue 817 idle timeout log level (#824)
* fix(transport): downgrade idle timeout log from error to debug Idle keep-alive timeout is normal zombie-session cleanup, not a transport failure. Route it through a dedicated WorkerQuitReason::IdleTimeout variant. Log it at debug level instead of treating it as a fatal error. Remove the unused LocalSessionWorkerError::KeepAliveTimeout variant. Closes #817 * fix(session): tolerate dead worker in close_session Swallow SessionServiceTerminated in close_session when the worker has already exited. This prevents a spurious ERROR log during the post-exit cleanup path in spawn_session_worker. * fix(transport): address PR review feedback - deprecate KeepAliveTimeout - harden tests
This commit is contained in:
parent
014fb2e6cd
commit
2f8d3b7355
1 changed files with 269 additions and 6 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use std::borrow::Cow;
|
||||
use std::{borrow::Cow, time::Duration};
|
||||
|
||||
use tokio_util::sync::CancellationToken;
|
||||
use tracing::{Instrument, Level};
|
||||
|
|
@ -22,6 +22,8 @@ pub enum WorkerQuitReason<E> {
|
|||
TransportClosed,
|
||||
#[error("Handler terminated")]
|
||||
HandlerTerminated,
|
||||
#[error("Worker idle timeout after {}ms", _0.as_millis())]
|
||||
IdleTimeout(Duration),
|
||||
}
|
||||
|
||||
impl<E: std::error::Error + Send + 'static> WorkerQuitReason<E> {
|
||||
|
|
@ -122,7 +124,8 @@ impl<W: Worker> WorkerTransport<W> {
|
|||
.inspect_err(|e| match e {
|
||||
WorkerQuitReason::Cancelled
|
||||
| WorkerQuitReason::TransportClosed
|
||||
| WorkerQuitReason::HandlerTerminated => {
|
||||
| WorkerQuitReason::HandlerTerminated
|
||||
| WorkerQuitReason::IdleTimeout(_) => {
|
||||
tracing::debug!("worker quit with reason: {:?}", e);
|
||||
}
|
||||
WorkerQuitReason::Join(e) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue