Repository navigation
fix(hub): the hub's last lines reach the pool, and a hung hub is logged - #506
Merged
Merged
Conversation
The hub ended itself with `std::process::exit` right after its last line (`hub_stop` before an update, `hub_stuck` from the watchdog), before the minute's telemetry was sent: a member's hub_stop appeared once in 30 days of pool telemetry against 66 in its own log. It now flushes first, through `exit::exit`, and a test keeps every exit of the hub on that path. The `hub_hung` line came from the start that ended the hung hub (the CLI, the MCP server), which keeps no log, so it was dropped. That start now leaves a note, and the hub it starts logs it. Refs #398 Bug-Class: lost-last-words Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 10, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Checking #398 against 30 days of pool telemetry found no hung hub since the watchdog came (0.34.0), but also showed that the telemetry could not have shown one:
std::process::exitright after its last line (hub_stopbefore an update,hub_stuckfrom the watchdog), before the minute's telemetry was sent. One member'shub_stopappears once in the pool against 66 times in its ownhub.log. The hub now flushes first (exit::exit, as the daemon already does atdaemon_stop), and a test keeps every exit of the hub on that path.hub_hungwent nowhere. It came from the start that ended the hung hub (ensure_runningin the CLI or the MCP server), which keeps no log, sodiag::warndropped it. That start now leaveshub-hung.json, and the hub it starts logshub_hungfrom it.lost-last-wordslib.rs(shutdown) andwatchdog.rs; the note test did not compile withoutnote_hung/take_hung. Green after the fix.process::exit, already flushes atdaemon_stop. Node: its Windows restart ends the process without a line just before it, and on Unix itexecs; left as is. Test helpers (stdio.rsfake server) are exempt.exit::tests::the_hub_ends_itself_only_through_exitNot seen in the stack: a hung hub cannot be made on demand; after the release the pool's telemetry should show
hub_stopbeside each update.Refs #398
🤖 Generated with Claude Code