Skip to content

Commit

Permalink
[backend] BackendJobDone should be sent to the job initiating client
Browse files Browse the repository at this point in the history
Otherwise in database-shared multi-client (multiprocess) setup, another
client can kill a job it does not own and receive a JobDone it cannot process.
  • Loading branch information
anthonygego authored and GuillaumeDerval committed Dec 14, 2022
1 parent 443e0e2 commit d84f8c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inginious/backend/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ async def handle_client_kill_job(self, client_addr, message: ClientKillJob):
waiting_job = self._waiting_jobs.pop(message.job_id)
previous_state = waiting_job.msg.inputdata.get("@state", "")

# Do not forget to send a JobDone
await ZMQUtils.send_with_addr(self._client_socket, client_addr, BackendJobDone(message.job_id, ("killed", "You killed the job"),
0.0, {}, {}, {}, previous_state, None, "", ""))
# Do not forget to send a JobDone to the initiating client
await ZMQUtils.send_with_addr(self._client_socket, waiting_job.client_addr, BackendJobDone(
message.job_id, ("killed", "You killed the job"), 0.0, {}, {}, {}, previous_state, None, "", ""))
# If the job is running, transmit the info to the agent
elif message.job_id in self._job_running:
running_job = self._job_running[message.job_id]
Expand Down

0 comments on commit d84f8c9

Please sign in to comment.