Skip to content

builder: handle Ctrl+C on Windows - #743

Merged
jkloetzke merged 1 commit into
BobBuildTool:masterfrom
jkloetzke:windows-ctrl-c
Nov 16, 2026
Merged

jkloetzke merged 1 commit into
BobBuildTool:masterfrom
jkloetzke:windows-ctrl-c

Conversation

@jkloetzke

Copy link
Copy Markdown
Member

On Windows, the asyncio event loop does not support signal handlers. Ctrl+C thus raised a KeyboardInterrupt somewhere in the event loop instead of gracefully cancelling all jobs. Install a regular signal handler instead that defers the cancellation into the event loop.

Because the console delivers Ctrl+C to all attached processes, the spawned process pool workers need to ignore SIGINT explicitly. Otherwise idle workers die with a KeyboardInterrupt backtrace.

Interrupted processes do not return -SIGINT on Windows but STATUS_CONTROL_C_EXIT. Recognize this exit code too so that the user gets the proper "User aborted" message.

On Windows, the asyncio event loop does not support signal handlers.
Ctrl+C thus raised a KeyboardInterrupt somewhere in the event loop
instead of gracefully cancelling all jobs. Install a regular signal
handler instead that defers the cancellation into the event loop.

Because the console delivers Ctrl+C to all attached processes, the
spawned process pool workers need to ignore SIGINT explicitly. Otherwise
idle workers die with a KeyboardInterrupt backtrace.

Interrupted processes do not return -SIGINT on Windows but
STATUS_CONTROL_C_EXIT. Recognize this exit code too so that the user
gets the proper "User aborted" message.
@codecov

codecov Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.42%. Comparing base (f8d2851) to head (fcbb7e3).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #743      +/-   ##
==========================================
+ Coverage   90.41%   90.42%   +0.01%     
==========================================
  Files          59       59              
  Lines       17451    17459       +8     
==========================================
+ Hits        15779    15788       +9     
+ Misses       1672     1671       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jkloetzke
jkloetzke merged commit 75161fb into BobBuildTool:master Nov 16, 2026
11 checks passed
@jkloetzke
jkloetzke deleted the windows-ctrl-c branch November 16, 2026 21:18
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.

1 participant