Skip to content

Commit

Permalink
orphaned subjobs at job_history_duration expiry and a race scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
Shrinivas Harapanahalli committed May 4, 2018
1 parent 22cdb01 commit 13568cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/server/req_delete.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ req_deletejob(struct batch_request *preq)
sjst = get_subjob_state(parent, i);
if ((sjst == JOB_STATE_EXITING) && !forcedel)
continue;
if ((sjst != JOB_STATE_QUEUED) && (pjob = find_job(mk_subjob_id(parent, i)))) {
if ((pjob = find_job(mk_subjob_id(parent, i)))) {
if (delhist)
pjob->ji_deletehistory = 1;
if (pjob->ji_qs.ji_state == JOB_STATE_EXPIRED) {
Expand Down
3 changes: 2 additions & 1 deletion src/server/svr_jobfunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -5290,7 +5290,8 @@ svr_clean_job_history(struct work_task *pwt)
nxpjob = (job *)GET_NEXT(pjob->ji_alljobs);

if ((pjob->ji_qs.ji_state == JOB_STATE_MOVED) ||
(pjob->ji_qs.ji_state == JOB_STATE_FINISHED)) {
(pjob->ji_qs.ji_state == JOB_STATE_FINISHED) ||
(pjob->ji_qs.ji_state == JOB_STATE_EXPIRED)) {

if (!(pjob->ji_wattr[(int) JOB_ATR_history_timestamp].at_flags & ATR_VFLAG_SET)) {
if (pjob->ji_qs.ji_state == JOB_STATE_MOVED)
Expand Down

0 comments on commit 13568cb

Please sign in to comment.