Skip to content

feat: add graceful shutdown with in-flight request drain (#732) - #916

Open
cristinadnicholson-pixel wants to merge 1 commit into
ritik4ever:mainfrom
cristinadnicholson-pixel:feature/issue-732
Open

feat: add graceful shutdown with in-flight request drain (#732)#916
cristinadnicholson-pixel wants to merge 1 commit into
ritik4ever:mainfrom
cristinadnicholson-pixel:feature/issue-732

Conversation

@cristinadnicholson-pixel

Copy link
Copy Markdown

Commit Type

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (formatting, etc.)
  • refactor: A code change that neither fixes a bug nor adds a feature
  • perf: A code change that improves performance
  • test: Adding missing or correcting existing tests
  • build: Changes affecting the build system or external dependencies
  • ci: Changes to CI/CD configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit

Breaking change? (If yes, add BREAKING CHANGE in the commit footer)

  • Yes — this contains a breaking change
  • No

What changed

  • Added graceful shutdown handling for SIGTERM and SIGINT in backend/src/index.ts.
  • Stop accepting new connections and allow in-flight requests to drain for up to 30 seconds.
  • Added clean SQLite WAL checkpointing during shutdown.
  • Gracefully stop and close the indexer before the process exits.
  • Added shutdown logging with the shutdown reason and total shutdown duration.
  • Ensured shutdown completes cleanly without abruptly terminating active requests.

Testing done

  • Verified the application handles SIGTERM and SIGINT correctly.
  • Verified in-flight requests are allowed to complete during shutdown.
  • Verified the 30-second drain timeout is enforced.
  • Verified the SQLite WAL is checkpointed before exit.
  • Verified the indexer is stopped and closed gracefully.
  • Verified shutdown reason and duration are logged.

Related issues

Closes #732

Checklist

  • I used the correct commit type (see above) for the squashed commit message.
  • I kept the change focused on the related issue.
  • I added or updated tests where useful.
  • I updated documentation where behavior changed.
  • I verified the app still builds or explained why verification was skipped.
  • My commits follow [Conventional Commits](https://www.conventionalcommits.org/) (enforced by commitlint).

@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the ritik4ever's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@cristinadnicholson-pixel 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

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 262ae83c-4d22-4fec-9b25-3f5dcc140ca4


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

[FEATURE] Add graceful shutdown with in-flight request drain

1 participant