Repository navigation
fix(daemon-client): say that a hung daemon is stopped before ensureDaemon starts a new one - #4803
Conversation
Size Report
Startup median (7 runs, lower is better):
|
f4b4bd5 to
58aa019
Compare
|
Coordinator review: held as a draft for a maintainer decision. The code does what the brief asked, and the brief is mine. On review I think the brief under-weighted one risk. Every existing use of the liveness probe follows a request that already timed out, so the daemon has been silent for a long window before three probes are allowed to end it. This path has no such earlier evidence. Any The defect is real: the timeout hint tells SDK clients to call Options:
Also to fix in any option: the |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 58aa019. The verdict and the full list are in the summary comment.
…emon starts a new one The timeout hint and two comments read as if ensureDaemon() replaced a compatible daemon that answers nothing. It reuses that daemon. The hint now states the order: stop, then ensure. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
58aa019 to
483a8d6
Compare
|
This PR is ready at 483a8d6. It changes only the timeout hint and two comments in daemon-client: the hint now gives the order (stop the daemon, then retry, and an SDK client calls |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 483a8d6. The verdict and the full list are in the summary comment.
…nections Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
* origin/main: feat(gesture): hold before the move with gesture pan --hold-ms (#4767) docs: clarify device verification and security proposals (#4805) fix(daemon-client): say that a hung daemon is stopped before ensureDaemon starts a new one (#4803) test: remove five timing races from CI (#4800) refactor(remote): save a remote script from memory with the local publisher (#4802) refactor(apple-runner): one RUNNER_ERROR_CODES row per runner error code with parity/docs gates (#4774) fix(android): require acknowledgements for test IME typing (#4722) feat(scroll): add scroll refresh for pull-to-refresh (#4770) refactor(host-kit): add request Scope and use it for the wait capture deadline (#4794) fix(android): let permission all change nothing on an app that declares no permissions (#4796) fix(cli): replace the CLI session and generated remote config instead of rewriting them in place (#4797) fix(host-kit): accept a group-writable script directory the user owns (#4799)
Problem
When an attach client's request times out and the daemon answers no liveness probe, the hint said: "Stop it with
<stop command>, then retry. SDK clients call ensureDaemon() to start a fresh one." Two comments said "ensureDaemonis where an unresponsive one is replaced".Both read as if
ensureDaemon()replaces a same-version daemon that answers nothing. It does not: a compatible daemon that accepts a connection is reused without a question. An SDK client that follows the hint without the stop receives the same daemon again.Change
The hint states the order: stop the daemon, then retry, and an SDK client calls
ensureDaemon()after the stop. The two comments say whatensureDaemondoes with a compatible daemon. No behavior changes.Why not replace the daemon in
ensureDaemon()An earlier version of this PR made
ensureDaemon()force-retire a compatible daemon that failed three 1 s liveness probes. That was withdrawn (maintainer decision): every other use of the probe follows a request that already timed out, and this path had no such evidence. About 3.4 s of silence on an overloaded shared host is not proof of a hang, and the retirement ends every other client's sessions.Evidence
packages/daemon-client/src/__tests__/daemon-client-timeout-route.test.ts(10 tests) passes; "an attach client leaves a daemon that answers no probe running" pins the hint.Size
Production: +5 −4, net +1 line (comment text). No startup cost change.
Part of #4649.
🤖 Generated with Claude Code