Skip to content

Commit 2c82746

Browse files
handle tcp rst
1 parent 8f0c75b commit 2c82746

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

shotover/src/source_task.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -587,11 +587,13 @@ pub fn spawn_read_write_tasks<
587587
return;
588588
}
589589
Err(CodecReadError::Io(err)) => {
590-
// I suspect (but have not confirmed) that UnexpectedEof occurs here when the ssl client
591-
// does not send "close notify" before terminating the connection.
592-
// We shouldnt report that as a warning because its common for clients to do
593-
// that for performance reasons.
594-
if !matches!(err.kind(), ErrorKind::UnexpectedEof) {
590+
// These IO errors indicate unexpected client disconnects:
591+
// - UnexpectedEof: SSL client closes without "close notify"
592+
// - ConnectionReset: client process crashed or was killed (TCP RST)
593+
if !matches!(
594+
err.kind(),
595+
ErrorKind::UnexpectedEof | ErrorKind::ConnectionReset
596+
) {
595597
warn!("failed to receive message on tcp stream: {err:?}");
596598
}
597599
return;

0 commit comments

Comments
 (0)