Skip to content

Commit

Permalink
BugFix: don't pop a job from running_jobs if it isn't there
Browse files Browse the repository at this point in the history
This could happen if there's a node failure and ARC is restarted
  • Loading branch information
alongd committed Mar 20, 2019
1 parent 0f47ba9 commit 7fc0755
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arc/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,11 @@ def end_job(self, job, label, job_name):
fine=job.fine, software=job.software, shift=job.shift, trsh=job.trsh, memory=job.memory,
conformer=job.conformer, ess_trsh_methods=job.ess_trsh_methods, scan=job.scan,
pivots=job.pivots, occ=job.occ, scan_trsh=job.scan_trsh, scan_res=job.scan_res)
self.running_jobs[label].pop(self.running_jobs[label].index(job_name))
if job_name in self.running_jobs[label]:
self.running_jobs[label].pop(self.running_jobs[label].index(job_name))
if job.job_status[0] != 'running' and job.job_status[1] != 'running':
self.running_jobs[label].pop(self.running_jobs[label].index(job_name))
if job_name in self.running_jobs[label]:
self.running_jobs[label].pop(self.running_jobs[label].index(job_name))
self.timer = False
job.write_completed_job_to_csv_file()
logging.info(' Ending job {name} for {label} (run time: {time})'.format(name=job.job_name, label=label,
Expand Down

0 comments on commit 7fc0755

Please sign in to comment.