fix: await application connection shutdown by coleleavitt · Pull Request #666 · wei/pull · GitHub
Skip to content

fix: await application connection shutdown - #666

Open
coleleavitt wants to merge 2 commits into
wei:masterfrom
coleleavitt:fix/issue-660-graceful-shutdown
Open

coleleavitt wants to merge 2 commits into
wei:masterfrom
coleleavitt:fix/issue-660-graceful-shutdown

Conversation

@coleleavitt

@coleleavitt coleleavitt commented Sep 14, 2026

Copy link
Copy Markdown

Summary

  • await MongoDB disconnect and Redis quit before exiting on SIGINT/SIGTERM
  • make repeated/mixed signal handling idempotent
  • settle and log cleanup failures without skipping the other cleanup or final exit
  • add deterministic shutdown coordinator tests

Verification

  • deno task check
  • deno task test (35 passed)
  • git diff --check

Fixes #660.

Summary by CodeRabbit

  • Bug Fixes

    • Improved application shutdown handling to close database and cache connections before exiting.
    • Shutdown now continues safely when cleanup encounters errors.
    • Repeated shutdown signals no longer trigger duplicate cleanup operations.
  • Tests

    • Added coverage for successful, repeated, and error-affected shutdown scenarios.
  • Refactor

    • Standardized shutdown behavior across termination signals.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unawaited disconnectMongoDB() + redisClient.quit() in SIGINT/SIGTERM handler race Deno.exit(0)

1 participant