Skip to content

Fix/runtime lifecycle cleanup - #513

Merged
0xNgoo merged 7 commits into
0xNgoo:mainfrom
shayam137-glitch:fix/runtime-lifecycle-cleanup
Aug 31, 2026
Merged

Fix/runtime lifecycle cleanup#513
0xNgoo merged 7 commits into
0xNgoo:mainfrom
shayam137-glitch:fix/runtime-lifecycle-cleanup

Conversation

@shayam137-glitch

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR tightens the runtime lifecycle and queue behavior around startup failures and worker restarts.

  • Rolls back database, queue, watcher, and router resources when plugin initialization fails so startup errors do not leak timers, workers, or open DB handles.
  • Preserves the original plugin error instead of masking it with a later failure.
  • Makes repeated queue start() calls idempotent for the same worker and rejects a different active worker callback to avoid silent callback replacement.
  • Defines explicit behavior for unknown queue job types by failing loudly instead of silently dropping them.
  • Adds focused regression tests covering plugin rollback, restart semantics, and queue safety.

How to test?

  1. Run the full project test suite:
    • bun test
  2. Confirm the lifecycle and queue coverage passes, especially the focused checks for:
    • failed plugin init rollback
    • queue worker replacement rejection
    • queue stop/restart processing behavior
    • unknown job type dispatch failure

Checklist

  • My code follows the code style of this project.
  • I have added tests for my changes.
  • I have updated the documentation accordingly.
  • I have run bun run test locally.
  • I have run bun run lint locally.

Issue Reference

Closes #468
Closes #470
Closes #471
Closes #473

@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@shayam137-glitch Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@0xNgoo
0xNgoo merged commit 25873cb into 0xNgoo:main Aug 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants