fix(server): Do not panic when a channel read fails
A read timeout or an abrupt client hang-up unwound the channel thread, which flooded the logs with "closing channel" panics and skipped the connected clients counter decrement, leaking a client slot each time. Fixes #256
This commit is contained in:
1 parent
c492bcc85f
commit
cb9cbacdd3
2 files changed
+54
-2
No files matched your search
@@ -216,9 +216,11 @@ impl ChannelHandle {
|
||||
}
|
||||
}
|
||||
Err(err) => {
|
||||
tracing::error!("closing channel thread with traceback: {}", err);
|
||||
// NOTE: Panicking here would unwind past the connected clients
|
||||
// counter decrement in `client()`, leaking a client slot.
|
||||
tracing::debug!("closing channel thread: {}", err);
|
||||
|
||||
panic!("closing channel");
|
||||
break 'handler;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user