-
Notifications
You must be signed in to change notification settings - Fork 51
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
flux-wreck cancel: fall back to kill -9 if job is not pending #1385
Conversation
src/cmd/flux-wreck
Outdated
elseif err == "Invalid argument" then | ||
prog:log ("Sending SIGKILL to %d\n", id) | ||
local rc, err = f:sendevent ({signal = 9}, "wreck.%d.kill", id) | ||
if not rc then self:die ("signal: %s\n", err) end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
If sched.cancel
rpc will respond with EINVAL
if the state of the target job is essentially not pending
(including running
and completed
), hopefully there is no side effect for kill(-9) rpc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was lazy and do not check the real state of the job here. The wreck.N.kill
event is ignored if the job isn't running.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Great. LGTM otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review @dongahn!
Example:
|
Codecov Report
@@ Coverage Diff @@
## master #1385 +/- ##
==========================================
- Coverage 78.49% 78.49% -0.01%
==========================================
Files 162 162
Lines 29741 29741
==========================================
- Hits 23345 23344 -1
- Misses 6396 6397 +1
|
Fall back to kill -9 for running jobs in flux-wreck cancel. Fixes issue flux-framework#1379
Add -f, --force option to flux-wreck cancel to force kill with SIGKILL running jobs even when sched is not loaded.
Test --force option of flux-wreck cancel.
LGTM. Will merge after travis finishes. |
This addresses issue #1379 with a couple minor changes to
flux wreck cancel
. When sched is loaded and it getsEINVAL
error,cancel
will fall back to equivalent offlux wreck kill -9
on the job.I also added a
-f, --force
option which allowsflux wreck cancel
to work even if sched is not loaded, mainly so the code could be tested int2000-wreck.t
.