-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Graceful warning when trying to kill a worker that's running a stage #29
Comments
@sampsyo any comments on how to propogate exceptions into a worker? |
Hmm, not entirely sure what you mean. You’re trying to trap a ^C in one thread and signal another thread to handle it? Or are you trying to handle other exceptions and display them on the main thread? I don’t know what an Event is, but I think you’d use a standard synchronization construct like a condition variable or a concurrent queue. |
I want do the former where Ctrl-C in the main thread informs workers to release ongoing jobs (mark them as failed or revert them to the original state) and cleanup job files. Right now, if a worker is killed while executing a |
Aha! It’s a little tricky because you’d need to interrupt a running subprocess (e.g., a Alternatively, you could possibly imagine leaving the process hanging out there but just changing the status. In that case, you’d probably want to have the stage threads proactively inform the main thread which jobs they’re working on, and then the master can make state changes itself when it dies. Concurrency is hard! |
Trap the first Ctrl-C to workproc and show a warning if the worker is running a job.
On the second Ctrl-C, gracefully execute a cleanup phase to write back changes from the
make
stage.The text was updated successfully, but these errors were encountered: