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:
1 parent
c9394990ea
commit
debe03fb39
1 file changed
+6
-1
+6
-1
@@ -269,6 +269,7 @@ impl TrackerService {
|
|||||||
let deadline = tokio::time::Instant::now() + Duration::from_secs(secs);
|
let deadline = tokio::time::Instant::now() + Duration::from_secs(secs);
|
||||||
while out.len() < entry_cap {
|
while out.len() < entry_cap {
|
||||||
tokio::select! {
|
tokio::select! {
|
||||||
|
biased;
|
||||||
() = self.state.shutdown.cancelled() => {
|
() = self.state.shutdown.cancelled() => {
|
||||||
note = Some("server is shutting down; stopped early".to_owned());
|
note = Some("server is shutting down; stopped early".to_owned());
|
||||||
break;
|
break;
|
||||||
@@ -276,7 +277,11 @@ impl TrackerService {
|
|||||||
r = tokio::time::timeout_at(deadline, rx.recv()) => match r {
|
r = tokio::time::timeout_at(deadline, rx.recv()) => match r {
|
||||||
Ok(Some(e)) => out.push(e),
|
Ok(Some(e)) => out.push(e),
|
||||||
Ok(None) => {
|
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;
|
break;
|
||||||
}
|
}
|
||||||
Err(_) => break,
|
Err(_) => break,
|
||||||
|
|||||||
Reference in new issue
Block a user