So I went into a bit of a rabbit whole last week! CI on windows kept on getting this particular error:
2: [WARNING] [python.exe-2]: 'SIGINT' sent to process[python.exe-2] not supported on Windows, escalating to 'SIGTERM'
Apparently, windows does not have a proper way to handle SIGINT, which means that it always straight goes to the ungraceful shutdown of SIGTERM.
So I thought “oh! is that perhaps the reason why we keep getting all of the unhandy access violation ( 3221225477) that we see ever since we went switched ci to server-2025?”
The answer is… it’s not that simple…
I tried these two repositories on CI where I tried to have the testing use the proper CTRL_C_EVENT, CTRL_BREAK_EVENT signals and such:
- GitHub - knmcguire/osrf_pycommon at new-sigterm-win · GitHub (I had to remove osrf_pycommon from pixi.toml)
- (Renamed from ros2/launch) GitHub - knmcguire/ros2_launch at new-sigterm-win · GitHub
… which resulted in this CI run with even more failures than before: https://ci.ros2.org/job/ci_windows/28952/
So this went a little too deep then I was comfortable with, but I at least tried to implement some of the suggestions given in these issues and old and closed PR
Anyway! I failed in this but perhaps someone interested to give more ideas and thoughts, and perhaps want to have a go? It would be nice to actually terminate windows nodes properly this time, and might also fix some other things in the process as well. In general there have been many complaints of ghost processes still hanging after termination, not only on Windows.
This is a list of intersting issues and PRs I saw open during my research, as it might be handy for others as well:
- Windows Signal Handling Issue · GitHub
- Hang after repeated ctrl+c on Windows Hang after repeated ctrl+c on Windows · Issue #310 · ros2/launch_ros · GitHub
- Tests on Windows falsely positive reporting passed due to SIGINT handling Tests on Windows falsely positive reporting passed due to SIGINT handling · Issue #767 · ros2/launch · GitHub
- incorrect signal handling: Incorrect signal handling · Issue #666 · ros2/launch · GitHub
- Kill dangling subprocesses https://github.com/ros2/launch/pull/632
- Ivanpauno/kill dangling subprocesses
- Ivanpauno/kill dangling subprocesses by anton-matosov · Pull Request #936 · ros2/launch · GitHub
- Gracefully handle CTRL+C and CTR+Break events on Windows Issue · GitHub
- Gracefully handle CTRL+C and CTR+Break events on Windows Gracefully handle CTRL+C and CTR+Break events on Windows by MichaelOrlov · Pull Request #1342 · ros2/rosbag2 · GitHub
- Gracefully handle SIGINT and SIGTERM in rosbag2 recorder https://github.com/ros2/rosbag2/pull/1301
- Use signal.CTRL_C_EVENT on windows instead of signal.SIGINT Use signal.CTRL_C_EVENT on windows instead of signal.SIGINT by ivanpauno · Pull Request #306 · ros2/launch · GitHub
Love to hear your thoughts!