Repository navigation
fleet gh: keep cache-serve alive — serve() joins the accept thread (code#10742) - #10826
Conversation
…stead of falling through to its failure exit (code#10742)
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 7 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
What
fleet gh cache-servecould never stay up.gh_cache::serve()delegated toserve_on(), which spawns the accept loop on a background thread and returns immediately;serve()then fell through to its "listener failed; exiting" path and the process died — bound, printed the failure line, exited, before answering a single request.Found live 2026-11-16 while verifying the #10742 acceptance proof (task 17509): built the merged binary from main, ran
fleet gh cache-serve --bind 127.0.0.1:4802, andcache-statusstayed DOWN with exactly that bind-then-die log. The loopback test exercisesserve_ondirectly, so the defect shipped green in #10815.Fix
serve_onnow returns the accept thread'sJoinHandlealongside the cache.serve()joins the accept thread: it returns (via the failure exit) only when the accept loop actually breaks.Tests (oracle: the daemon entry point, not just serve_on)
serve_entry_point_stays_up_and_caches: spawns the realserve()on a free port, drives it with real TCP clients — first call mints once, second is served from the daemon cache (mint count stays 1), andserve()is still running while its listener is healthy.cargo test -p fleet --bin fleet: 50 tests — all gh_cache tests pass (7/7); one unrelated flake (gh::tests::write_not_repeated_on_unknown_failure, ETXTBSY on its fake-gh script under load) passes on solo re-run.cargo test -p fleet-config --libuntouched by this change.Live proof (laptop, binary built from this branch)
cache-statusbefore daemon: DOWN (connection refused) on both configured addresses.entries=0 hits=0 misses=0.fleet gh api usercalls through the daemon:entries=1 hits=2 misses=1— one mint, repeats served from cache, no re-mint.Refs #10742 (already closed by #10815; this is the defect that made its daemon leg unusable, found by its self-closing checker task 17509).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.