Skip to content

fix: keep supervisor listen socket reusable across restarts - #209

Open
richardmilles wants to merge 1 commit into
manaflow-ai:mainfrom
richardmilles:fix/125-supervisor-restart-outage
Open

richardmilles wants to merge 1 commit into
manaflow-ai:mainfrom
richardmilles:fix/125-supervisor-restart-outage

Conversation

@richardmilles

@richardmilles richardmilles commented Aug 7, 2026

Copy link
Copy Markdown

Bind with SO_REUSEPORT and add deploy/macos/overlap-restart-supervisor.sh so SIGTERM drain is not a hard outage.
Fixes #125

Made with Cursor


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Make supervisor restarts seamless by binding the public TCP listener with SO_REUSEPORT and adding a macOS overlap-restart helper. The new process can now bind before the old one drains, avoiding the drain-window outage.

  • Bug Fixes
    • On Unix, bind the public listener with SO_REUSEPORT so a replacement supervisor can listen before SIGTERM closes the old process; non-Unix falls back to a normal Listen.
    • Add deploy/macos/overlap-restart-supervisor.sh to start a successor via launchd using the same ProgramArguments, then stop the old service, removing the multi-minute outage during restarts.

Written for commit ef4e3dd. Summary will update on new commits.

Review in cubic

Bind with SO_REUSEPORT and ship an overlap-restart helper so launchd
KeepAlive no longer equals a multi-minute outage (manaflow-ai#125).
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@richardmilles, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 52 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4ffaaf49-334e-4657-a883-fded677f7083

📥 Commits

Reviewing files that changed from the base of the PR and between 29c7ebb and ef4e3dd.

📒 Files selected for processing (5)
  • cmd/subrouter/front.go
  • cmd/subrouter/listener_reuseport_other.go
  • cmd/subrouter/listener_reuseport_unix.go
  • cmd/subrouter/supervisor.go
  • deploy/macos/overlap-restart-supervisor.sh

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.

Supervisor restart is a multi-minute total outage: TCP listener closes at SIGTERM while drain blocks the replacement

1 participant