Repository navigation
fix(worker): finish updates after device cleanup fails - #967
Merged
Merged
Conversation
nixuuu
enabled auto-merge (squash)
November 18, 2026 14:50
nixuuu
added a commit
that referenced
this pull request
Nov 18, 2026
## Change After a worker falls back from an unavailable saved secure route, SIGTERM can race the first configuration probe. A probe that returns after shutdown has stopped the CLI check timer can start it again. The process then stays alive even after the journal and connections have closed. Check shutdown state before and after probing. Configuration that loses the race is reported as unapplied. The next worker process applies the configuration on connection. Fixes: #967 Related: #974 ## Verification - Reproduced exit code 137 using the worker route migration test on the commit for #967. The same test passed on its parent. - All 8 tests in the worker route migration, worker shutdown, and worker update cleanup suites passed with this change through `check:tmp`. - Worker typecheck, targeted lint and formatting, and `git diff --check` passed. GitHub CI runs the full gate.
This was referenced Nov 18, 2026
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.
Change
An Android AVD whose reservation contains only the configuration name can leave a binary worker offline during a nightly update. The ownership check correctly refuses to stop the emulator, but the error used to interrupt shutdown after the executable was replaced and the reporting channel was canceled.
Updates and supervisor handover now share the graceful stop path with signal-driven shutdown. The worker logs the cleanup error, attempts to flush the journal, and exits with the requested supervisor code. The durable AVD reservation stays in place for recovery after startup. The update result still follows WorkerLink startup confirmation or the supervisor's rollback.
Fixes: #910
Verification
agent-device. It verifies that the worker comes back active after supervisor handover, reports success for the same attempt, retains the reservation, and sends no emulator shutdown command.check:tmpacross the new regression, worker shutdown, and the device backend and pool.check:tmpfor rollback and retrying a lost failure report.git diff --checkpassed. GitHub CI runs the full gate.