Skip to content

Commit

Permalink
Merge pull request #59 from felix5572/master
Browse files Browse the repository at this point in the history
fix ResourceWarning in issue #47 (#issue41 comment 8)
  • Loading branch information
felix5572 committed Jun 16, 2021
2 parents 25d0e22 + 062603f commit 800fd8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions dpdispatcher/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ def do_submit(self, job):
script_file_name = job.script_file_name
job_id_name = job.job_hash + '_job_id'
self.context.write_file(fname=script_file_name, write_str=script_str)
proc = self.context.call('cd %s && exec bash %s' % (self.context.remote_root, script_file_name))

proc = self.context.call('cd %s && exec bash %s &' % (self.context.remote_root, script_file_name) )
proc.wait()
# proc.kill()
job_id = int(proc.pid)
# print('shell.do_submit.job_id', job_id)
self.context.write_file(job_id_name, str(job_id))
return job_id

Expand Down
2 changes: 1 addition & 1 deletion dpdispatcher/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ def handle_unexpected_job_state(self):
raise RuntimeError("job_state for job {job} is unknown".format(job=self))

if job_state == JobStatus.terminated:
dlog.info(f"job: {self.job_hash} terminated; restarting job")
dlog.info(f"job: {self.job_hash} {self.job_id} terminated; restarting job")
if self.fail_count > 3:
raise RuntimeError("job:job {job} failed 3 times".format(job=self))
self.fail_count += 1
Expand Down

0 comments on commit 800fd8b

Please sign in to comment.