Skip to content

Commit

Permalink
Ensure SPANK prolog and epilog run without an explicit PlugStackConfig.
Browse files Browse the repository at this point in the history
If not set, the plugstack option will be populated from
get_extra_conf_path() instead, which means these direct tests on
the option will fail and the SPANK prolog/epilog will not run.

Regression from abd4db7 where the default option was no longer
always filled in.

Bug 9081.

Signed-off-by: Tim McMullan <mcmullan@schedmd.com>
  • Loading branch information
wickberg committed Dec 4, 2020
1 parent a8a91f6 commit 246ccd1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
1 change: 1 addition & 0 deletions NEWS
Expand Up @@ -7,6 +7,7 @@ documents those changes that are of interest to users and administrators.
-- select/cray_aries - Correctly remove jobs/steps from blades using NPC.
-- Fix false positive oom-kill events on extern step termination when
jobacct_gather/cgroup configured.
-- Ensure SPANK prolog and epilog run without an explicit PlugStackConfig.

* Changes in Slurm 20.02.6
==========================
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/prep/script/prep_script_slurmd.c
Expand Up @@ -74,7 +74,6 @@ extern int slurmd_script(job_env_t *job_env, slurm_cred_t *cred,
char *path = is_epilog ? slurmctld_conf.epilog :
slurmctld_conf.prolog;
char **env = _build_env(job_env, cred, is_epilog);
struct stat stat_buf;
int status = 0, rc;
uint32_t jobid = job_env->jobid;
int timeout = slurmctld_conf.prolog_epilog_timeout;
Expand All @@ -93,7 +92,7 @@ extern int slurmd_script(job_env_t *job_env, slurm_cred_t *cred,
* If both "script" mechanisms fail, prefer to return the "real"
* prolog/epilog status.
*/
if (conf->plugstack && (stat(conf->plugstack, &stat_buf) == 0))
if (spank_plugin_count())
status = _run_spank_job_script(name, env, jobid);
if ((rc = run_script(name, path, jobid, timeout, env, job_env->uid)))
status = rc;
Expand Down
8 changes: 1 addition & 7 deletions src/slurmd/slurmd/req.c
Expand Up @@ -5227,7 +5227,6 @@ _rpc_complete_batch(slurm_msg_t *msg)
static void
_rpc_terminate_job(slurm_msg_t *msg)
{
bool have_spank = false;
int rc = SLURM_SUCCESS;
kill_job_msg_t *req = msg->data;
uid_t uid = g_slurm_auth_get_uid(msg->auth_cred);
Expand Down Expand Up @@ -5367,19 +5366,14 @@ _rpc_terminate_job(slurm_msg_t *msg)
uid);
}

if ((nsteps == 0) && !conf->epilog) {
struct stat stat_buf;
if (conf->plugstack && (stat(conf->plugstack, &stat_buf) == 0))
have_spank = true;
}
/*
* If there are currently no active job steps and no
* configured epilog to run, bypass asynchronous reply and
* notify slurmctld that we have already completed this
* request. We need to send current switch state on AIX
* systems, so this bypass can not be used.
*/
if ((nsteps == 0) && !conf->epilog && !have_spank) {
if ((nsteps == 0) && !conf->epilog && !spank_plugin_count()) {
debug4("sent ALREADY_COMPLETE");
if (msg->conn_fd >= 0) {
slurm_send_rc_msg(msg,
Expand Down

0 comments on commit 246ccd1

Please sign in to comment.