Repository navigation
Handle SIGTERM for a graceful shutdown that drains in-flight ingest ticks and HTTP requests #271
Description
Activity
- addedenhancementNew feature or requestNew feature or requestarea/backendBackend crates: api, store, ingest, webhooks, bin/serverBackend crates: api, store, ingest, webhooks, bin/serverdifficulty/mediumMedium difficultyMedium difficulty
on Sep 23, 2026 - addedStellar WaveIssues in the Stellar wave programIssues in the Stellar wave program
on Sep 24, 2026 graceuvala-collab commented
on Sep 24, 2026 More actions@graceuvala-collab has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
Hi! I’m a full-stack developer with a strong blockchain background. I’d love to handle this issue and can deliver a clean, reliable solution. Kindly assign it to me.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @graceuvala-collab to this issue.
Congratulations, @graceuvala-collab! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.
🧑💻 @graceuvala-collab: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
Warning
When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊
- added a commit that references this issue
on Sep 28, 2026 grantfox-oss commented
on Sep 28, 2026 grantfox-ossboton Sep 28, 2026 – with GrantFox OSSMore actions🎉 This issue has been marked as completed on GrantFox!
@graceuvala-collab's PR #375 was approved and merged by @Emmyt24.
🏆 @graceuvala-collab: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (188 total points). Track your full progress on GrantFox.
👏 Great work, @graceuvala-collab! Keep contributing to Octo-Protocol-org.
This issue has been completed by @graceuvala-collab as part of the Stellar Wave Program's 9th Wave 🥳
😎 @graceuvala-collab: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.
Description
bin/server/src/main.rsstarts the axum HTTP server and the ingest supervisor. Audit whether the process currently handlesSIGTERMgracefully (draining in-flight requests and letting an in-progress ingest tick finish its current page before the process exits) or exits immediately, which in a rolling-deploy environment (Kubernetes, ECS) can abort an in-flight ingest page mid-processing or drop an in-flight client request.Requirements and Context
with_graceful_shutdownand a signal-handling future.Suggested Execution
Branch:
feat/server/graceful-shutdownImplement Changes
tokio::signal::unix::signal(SignalKind::terminate())listener inbin/server/src/main.rs..with_graceful_shutdown(...)for the HTTP server.CancellationTokenfromtokio_util) that the ingest supervisor's loop checks between ticks, with a maximum drain timeout before forcing exit.Test and Commit
server_stops_accepting_new_connections_on_sigterm_but_drains_in_flight_ones(integration test using a slow test route).ingest_supervisor_finishes_its_current_tick_before_honoring_a_shutdown_signal.server_force_exits_after_the_drain_timeout_if_a_tick_hangs.cargo test --workspacelocally before committing.Example Commit Message
Guidelines
Closes #<issue-number>in the PR description.dev-branchbranch — PRs targetingmainwill not be reviewed.