Skip to content

fix(supervisor): stop polling closed graceful shutdown channel - #1755

Open
cyphercodes wants to merge 1 commit into
cloudflare:masterfrom
cyphercodes:fix/1753-graceful-shutdown-busy-loop
Open

cyphercodes wants to merge 1 commit into
cloudflare:masterfrom
cyphercodes:fix/1753-graceful-shutdown-busy-loop

Conversation

@cyphercodes

Copy link
Copy Markdown

Summary

  • handle the graceful-shutdown notification only once in the supervisor run loop
  • disable the local shutdown select case after receiving from the closed channel
  • add a deterministic regression showing the supervisor remains blocked while an active tunnel drains

Fixes #1753

Testing

  • /root/go/bin/go1.26.5 test -mod=readonly ./supervisor
  • /root/go/bin/go1.26.5 test -race -mod=readonly ./supervisor
  • /root/go/bin/go1.26.5 test -mod=readonly ./supervisor -run '^TestRunLoopHandlesGracefulShutdownOnce$' -count=20
  • make lint
  • git diff --check

The full make test command was also attempted. It encounters unrelated failures in crypto/TestSupportedCurvesNegotiation and ingress ICMP tests requiring ping/raw-socket access; the same failures reproduce on untouched master.

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.

🐛 After SIGTERM, cloudflared tunnel run uses 100% of one CPU core for the whole graceful-shutdown period

1 participant