Skip to content

fix: add gracefull shutdown when clicking stop button for proxy server#4

Merged
therealaleph merged 3 commits intotherealaleph:mainfrom
v4g4b0nd-0x76:fix/gracefull-shutdown-ui
Apr 22, 2026
Merged

fix: add gracefull shutdown when clicking stop button for proxy server#4
therealaleph merged 3 commits intotherealaleph:mainfrom
v4g4b0nd-0x76:fix/gracefull-shutdown-ui

Conversation

@v4g4b0nd-0x76
Copy link
Copy Markdown
Contributor

Fix graceful shutdown for GUI Stop button

Problem:

  • Clicking Stop in GUI didn't trigger proper shutdown sequence
  • Ports remained locked after stopping (address already in use)
  • "Shutdown signal received" log never appeared

Root Cause:
GUI was immediately aborting the proxy task right after sending shutdown signal, killing it before it could clean up resources.

Solution:

  • Send shutdown signal first
  • Wait up to 2 seconds for graceful shutdown
  • Only force-abort on timeout
  • Ports now release immediately when stopping

@v4g4b0nd-0x76
Copy link
Copy Markdown
Contributor Author

sorry if cargo fmt added more changes than required and i know its annoying to review.

@therealaleph therealaleph merged commit 35c33a3 into therealaleph:main Apr 22, 2026
therealaleph added a commit that referenced this pull request Apr 25, 2026
Thanks @v4g4b0nd-0x76 — proper listener teardown on Stop is exactly what was needed. The 2-second grace window + force-abort fallback is a clean pattern.
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.

2 participants