-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly set up SIGBREAK handling for dagster dev on windows (#27769)
## Summary & Motivation Previously I set up the `dagster dev` tests on Windows to manually terminate the full process tree. I did this because I could not get the full tree to terminate on its own from issuing an interrupt event. The theory was that `CTRL_BREAK_EVENT` was not propagating correctly in a windows CI environment due to the process tree not sharing a console. I think this theory was wrong, and in fact what was happening is that `CTRL_BREAK_EVENT` (aka `SIGBREAK`) does not trigger a `KeyboardInterrupt` exception by default-- instead it just wipes out the process. The logic that handles graceful shutdown of the process tree relies on a `KeyboardException` being triggered. This PR sets up the correct signal handling in `dagster dev` for `SIGBREAK` to trigger a `KeyboardInterrupt`. This causes the full process tree to shut down gracefully. The one caveat is that, for some reason in the legacy code server case (where webserver and daemon each spawn their own copy of the code server), it takes inordinately long on windows for the code server spawned from the webserver (but not daemon!) to self-delete after not receiving a heartbeat. I don't know why that is, but if we set timeout long enough (set to 120 seconds in this PR-- previously experimented up to 60, which wasn't enough) then it terminates successfully. ## How I Tested These Changes Remove the explicit killing of child processes in the windows `dagster dev` tests, they now pass without that.
- Loading branch information
Showing
2 changed files
with
53 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters