-
Notifications
You must be signed in to change notification settings - Fork 107
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
Have BKILL signal SIGKILL after SIGTERM #7482
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -735,24 +735,42 @@ void lsf_driver_kill_job(void *_driver, void *_job) { | |
char **argv = (char **)calloc(2, sizeof *argv); | ||
CHECK_ALLOC(argv); | ||
argv[0] = driver->remote_lsf_server; | ||
argv[1] = saprintf("%s %s %s", driver->bkill_cmd, "-s SIGKILL", | ||
argv[1] = saprintf("%s %s %s", driver->bkill_cmd, "-s SIGTERM", | ||
job->lsf_jobnr_char); | ||
|
||
spawn_blocking(driver->rsh_cmd, 2, (const char **)argv, NULL, NULL); | ||
|
||
free(argv[1]); | ||
free(argv); | ||
|
||
char **argv2 = (char **)calloc(2, sizeof *argv2); | ||
jonathan-eq marked this conversation as resolved.
Show resolved
Hide resolved
|
||
argv2[0] = driver->remote_lsf_server; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have not checked what CHECK_ALLOC is doing, but should it be included here as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
argv2[1] = saprintf("%s %s %s %s %s", "sleep 30;", driver->bkill_cmd, | ||
"-s", "SIGKILL", job->lsf_jobnr_char); | ||
spawn(driver->rsh_cmd, 2, (const char **)argv2, NULL, NULL); | ||
free(argv2[0]); | ||
free(argv2); | ||
|
||
} else if (driver->submit_method == LSF_SUBMIT_LOCAL_SHELL) { | ||
char **argv = (char **)calloc(3, sizeof *argv); | ||
CHECK_ALLOC(argv); | ||
argv[0] = saprintf("%s", "-s"); | ||
argv[1] = saprintf("%s", "SIGKILL"); | ||
argv[1] = saprintf("%s", "SIGTERM"); | ||
argv[2] = saprintf("%s", job->lsf_jobnr_char); | ||
spawn_blocking(driver->bkill_cmd, 3, (const char **)argv, NULL, NULL); | ||
free(argv[0]); | ||
free(argv[1]); | ||
free(argv[2]); | ||
free(argv); | ||
|
||
char **argv2 = (char **)calloc(2, sizeof *argv2); | ||
CHECK_ALLOC(argv2); | ||
argv2[0] = saprintf("%s", "-c"); | ||
argv2[1] = saprintf("%s %s %s %s %s", "sleep 30;", driver->bkill_cmd, | ||
"-s", "SIGKILL", job->lsf_jobnr_char); | ||
spawn((const char *)saprintf("%s", "/bin/sh"), 2, (const char **)argv2, | ||
"/dev/null", "/dev/null"); | ||
free(argv2[0]); | ||
free(argv2[1]); | ||
free(argv2); | ||
} | ||
} | ||
|
||
|
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.
I don't get why this
spawn_blocking
is removed, what use is there ofargv
when you justfree
it?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.
You are right, this was removed by accident