fix: allow persistence-safe shutdown budget - #9426
Open
Xipong wants to merge 1 commit into
Open
Conversation
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.
Summary
CAMOFOX_SHUTDOWN_TIMEOUT_MSconfigurationMotivation
Graceful shutdown awaits
server:shutdownlisteners before closing browser contexts. The persistence plugin uses that window to checkpoint storage state, optionally including IndexedDB. With multiple active sessions or larger IndexedDB state, the existing 10-second watchdog can terminate the process while those awaited checkpoints are still running.The watchdog remains bounded and armed before shutdown work begins; only its validated budget becomes configurable.
Verification
npm test -- --runInBand tests/unit/config.test.js tests/unit/shutdownBudget.test.js tests/unit/serverShutdownEvent.test.js plugins/persistence/plugin.test.js plugins/persistence/persistence.test.jsnpm run buildnpm run test:mcpnode --check server.jsThe new regression tests were added before the implementation and failed while
gracefulShutdown()still used the fixed 10-second value.Scope
This does not change checkpoint ordering, make persistence concurrent, enable IndexedDB by default, or alter normal runtime behavior. The only user-visible difference is the bounded wait during shutdown.