WS-F: report shutdown, not reader death, when journal channel closes on shutdown

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YShymaPrXmc3KYRUg2HMSs
This commit is contained in:
ariandClaude Sonnet 5.5 committed 2026-10-15 18:48:29 -04:00
1 parent c9394990ea
commit debe03fb39
1 file changed
+6 -1
+6 -1
View File
@@ -269,6 +269,7 @@ impl TrackerService {
let deadline = tokio::time::Instant::now() + Duration::from_secs(secs);
while out.len() < entry_cap {
tokio::select! {
biased;
() = self.state.shutdown.cancelled() => {
note = Some("server is shutting down; stopped early".to_owned());
break;
@@ -276,7 +277,11 @@ impl TrackerService {
r = tokio::time::timeout_at(deadline, rx.recv()) => match r {
Ok(Some(e)) => out.push(e),
Ok(None) => {
note = Some("journal reader closed before the time cap; this is not a quiet period, the reader stopped".to_owned());
note = Some(if self.state.shutdown.is_cancelled() {
"server is shutting down; stopped early".to_owned()
} else {
"journal reader closed before the time cap; this is not a quiet period, the reader stopped".to_owned()
});
break;
}
Err(_) => break,