Commit c690ca8e authored by BAIRE Anthony's avatar BAIRE Anthony

fix db accesses

context switches must not happen within a sqlalchemy transaction
parent 4a48d690
Pipeline #56534 failed with stage
in 53 seconds
......@@ -1329,10 +1329,10 @@ class JobManager(Manager):
ses = self.ctrl.session
with ses.begin():
state, = ses.query(Job.state).filter_by(id=info.job_id).one()
if state == JobState.ABORTING:
yield from self._notif_job_state(info, "ABORTING")
yield from stop(signal.SIGTERM, "user abort")
result = result or JobResult.ABORTED
if state == JobState.ABORTING:
yield from self._notif_job_state(info, "ABORTING")
yield from stop(signal.SIGTERM, "user abort")
result = result or JobResult.ABORTED
elif timeout_task.done():
# timeout !
......@@ -1562,7 +1562,7 @@ class JobManager(Manager):
else:
state = JobState (job.state) .name
result = JobResult(job.result).name
yield from self._notif_job_state(info, state, result)
yield from self._notif_job_state(info, state, result)
# send a notification to the aio frontend when the job state is changed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment