fix(aio): exec supervisord so the container handles stop signals - #9625
fix(aio): exec supervisord so the container handles stop signals#9625smalyu wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe startup script now uses ChangesSupervisor process launch
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to The change makes supervisord receive container stop signals directly without altering normal startup behavior; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Description
main()in the AIO entrypoint ends by launching supervisord as a child process:Because it is not
exec'd, PID 1 staysbashrunningstart.sh. A non-interactive bash ignoresSIGINTand does not forward signals to children, so a stop signal sent to the container reaches nothing that acts
on it: supervisord never begins its shutdown, and the runtime waits out its full stop timeout before
killing the container. On Docker (
SIGTERM, 10 s default) this shows up as everydocker stoptaking thefull grace period; on platforms that send
SIGINT— Fly.io, for example — the container sits until thehard kill.
Adding
execmakes supervisord PID 1, so it receives signals directly and shuts its programs down. In ourdeployment container stop went from the full timeout to about two seconds.
The call is the last statement of
main(), followed only bymain "$@", soexecreplaces the shellwithout skipping any code.
Type of change
Diff
Test scenarios
psinside a running containerbash /app/start.shsupervisorddocker stop(SIGTERM)SIGINT(Fly.io)References
Observed on
makeplane/plane-aio-community:v1.4.1running on Fly.io, where the stop signal isSIGINT.We currently carry this as a local patch.
Summary by CodeRabbit