Skip to content

Commit db32d1d

Browse files
author
rhc54
authored
Merge pull request #2577 from rhc54/topic/exitcode
Ensure jobs that fail always return a non-zero exit code.
2 parents 3cb3220 + 9f69b01 commit db32d1d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

orte/mca/errmgr/default_hnp/errmgr_default_hnp.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ static void job_errors(int fd, short args, void *cbdata)
142142
return;
143143
}
144144

145+
/* ensure we have an error exit status */
146+
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
147+
145148
/* if the jdata is NULL, then we abort as this
146149
* is reporting an unrecoverable error
147150
*/
@@ -177,6 +180,7 @@ static void job_errors(int fd, short args, void *cbdata)
177180
*/
178181
orte_routing_is_enabled = false;
179182
jdata->num_terminated = jdata->num_procs;
183+
/* activate the terminated state so we can exit */
180184
ORTE_ACTIVATE_JOB_STATE(caddy->jdata, ORTE_JOB_STATE_TERMINATED);
181185
/* if it was a dynamic spawn, then we better tell them this didn't work */
182186
if (ORTE_JOBID_INVALID != jdata->originator.jobid) {

0 commit comments

Comments
 (0)