Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow flux_subprocess_kill() on remote processes not yet running #2297
This PR is somewhat related to #2275.
When signalling a set of remote processes, it is inconvenient to handle the case of processes for which a request has been sent, but a response has not yet been received. Currently,
Instead of requiring the libsubprocess user to handle this case by tracking which remote processes have pending signals, this PR adds a
If a user calls
If the subprocess fails then the future is fulfilled with an error.
For testing new options were added to the
All this will make it much easier for the bulk exec code in the job-exec module to cancel a job due to an exception when the job is in the middle of starting up.
Problem: When a remote process is still in the INIT state, i.e. a remote exec request has been sent but the response not yet received, it is inconvenient for a caller to signal that remote process, since they must wait until the response is received that puts that process into the RUNNING state. Adjust flux_subprocess_kill() to allow a signal to be pending for remote processes that are not yet RUNNING. The signal will be forwarded once the state changes to RUNNING, or the signal will be canceled with error if the process fails to exec or for any other reason doesn't enter the RUNNING state.
Add two new options to the rexec test program related to testing flux_subprocess_kill(). * -k, --kill: send SIGTERM to processes once they are running * -K, --kill-immediately: send SIGTERM to processes immediately after flux_rexec()
Switch t0005-rexec.t to use basic t/rexec/rexec test program instead of specific rexec/rexec_signal program to drive the signal tests, now that the -k, -K options have been added.
The basic rexec test program now handles the duties of the more specific rexec_signal test. Remove rexec_signal since it is no longer used.
@@ Coverage Diff @@ ## master #2297 +/- ## ========================================== + Coverage 80.88% 80.89% +<.01% ========================================== Files 214 214 Lines 33654 33681 +27 ========================================== + Hits 27222 27245 +23 - Misses 6432 6436 +4