Skip to content

Fix SIGINT not closing Grayjay in headless/server mode#914

Open
VictorVow wants to merge 1 commit intofuto-org:masterfrom
VictorVow:fix/sigint-headless
Open

Fix SIGINT not closing Grayjay in headless/server mode#914
VictorVow wants to merge 1 commit intofuto-org:masterfrom
VictorVow:fix/sigint-headless

Conversation

@VictorVow
Copy link
Copy Markdown

Summary

  • Fixes Bug: SIGINT during --headless running doesn't close Grayjay #569
  • Registers a Console.CancelKeyPress handler that cancels the shared CancellationTokenSource on SIGINT (Ctrl+C), rather than letting the signal propagate unhandled
  • Registers an AppDomain.CurrentDomain.ProcessExit handler for the same token to cover SIGTERM
  • This unblocks WaitHandle.WaitOne() in headless/server mode (and WaitForExitAsync in windowed mode), allowing the cleanup sequence to run and the process to exit gracefully

Register Console.CancelKeyPress and AppDomain.ProcessExit handlers to
cancel the shared CancellationTokenSource on SIGINT/SIGTERM. This
unblocks the WaitHandle.WaitOne() call in headless mode (and the
WaitForExitAsync call in windowed mode), allowing cleanup to run and
the process to exit gracefully.

Fixes futo-org#569
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: SIGINT during --headless running doesn't close Grayjay

2 participants