v1.32.0.1 fix: browse daemon stop/restart crash-loop - defer shutdown after response#2020
Open
devkd111 wants to merge 1 commit into
Open
v1.32.0.1 fix: browse daemon stop/restart crash-loop - defer shutdown after response#2020devkd111 wants to merge 1 commit into
devkd111 wants to merge 1 commit into
Conversation
…ponse meta-commands.ts called await shutdown() before returning the HTTP response, tearing down the listener so the response never flushed. The CLI saw ECONNRESET, crash-retry re-sent the command, and the daemon logged 'crashed twice in a row' before exit. Fix: defer shutdown() via setTimeout(0) so the response flushes first. Added regression tests for both stop and restart commands. Version bump: 1.32.0.0 → 1.32.0.1
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
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.
Problem
meta-commands.tscase'stop'and'restart'callawait shutdown()BEFORE returning the HTTP response.shutdown()tears down the HTTP listener and callsprocess.exit(), so the response never flushes. The CLI seesECONNRESET, its crash-retry logic re-sends the command, and the daemon logs "crashed twice in a row" before exit.Fix
Replace
await shutdown()withsetTimeout(() => { shutdown(); }, 0)in both'stop'and'restart'cases. This defers the shutdown until after the current execution context completes, allowing the HTTP response to flush before the listener is torn down.Test
Added regression tests in
browse/test/commands.test.ts:Server Control > stop returns response before shutdown fires— verifies shutdown calls are deferred (not synchronous)Server Control > restart returns response before shutdown fires— same for restartServer Control > status returns healthy— baselineAll 226 existing tests pass, zero regressions.
Files changed
browse/src/meta-commands.ts— defer shutdown via setTimeout(0)browse/test/commands.test.ts— regression tests (3 new, 226 total pass)VERSION— bump 1.32.0.0 to 1.32.0.1package.json— bump 1.32.0.0 to 1.32.0.1CHANGELOG.md— entry for 1.32.0.1