Repository navigation
Run cleanup hooks before discarding failed plugin candidates - #8028
Closed
bb-slop-cop[bot] wants to merge 1 commit into
Closed
bb-slop-cop[bot] wants to merge 1 commit into
bb-slop-cop[bot] wants to merge 1 commit into
Conversation
Collaborator
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.
🚨 SLOP COP 🚨 ·
new-issue-autopilotHuman comments
What was wrong
Failed plugin candidates were invalidated without running their registered cleanup hooks. Plugin-created timers consequently outlived both the failed load and service shutdown, repeatedly using stale API handles. Reproduced twice against trusted
origin/mainat796cdcc0f4bf8a55e23664035c54e8db6fe9d272.Report: https://get-bb.github.io/reports/issues/8025.html
What changed
Share the existing reverse-order, per-hook error-isolated cleanup runner between normal disposal and failed-candidate discard. Await candidate hooks before closing databases or invalidating the API; retain the previous live instance after a failed reload. Add a service-level regression covering initial host-build rejection, initial factory failure, and failed reload factory cleanup, including asynchronous hooks and a throwing hook.
Two files; 207 changed text lines: 197 additions and 10 deletions. No dependencies, generated files, stored-data changes, public API, or wire changes. Diagnostic-report rate limiting remains outside this fix.
How you verified
pnpm exec turbo run test --filter=@bb/server -- test/services/plugins/plugin-candidate-cleanup.test.ts test/services/plugins/plugin-instance-lifecycle.test.ts— 16 tests passed.pnpm exec turbo run lint typecheck --filter=@bb/serverpassed.git diff --checkpassed;git diff --numstat origin/mainconfirms 207 text lines and no binary changes.Fixes #8025