Skip to content

Commit

Permalink
Don't crash when failing to read ZMQ reply in some circumstances
Browse files Browse the repository at this point in the history
  • Loading branch information
ximion committed Mar 24, 2024
1 parent 4b68604 commit 5d106b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spark/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ def send_job_status(self, job_id, status):
self._send_attempt_failed()
log.error('ZMQ error while waiting for reply: %s', str(e))
if sockev.get(self._sock) == zmq.POLLIN:
self._sock.recv_multipart() # discard reply
try:
self._sock.recv_multipart() # discard reply
except zmq.error.ZMQError as e:
log.error('ZMQ error, unable to receive reply: %s', str(e))
else:
log.error('Unable to send job status: No reply from master')

Expand Down

0 comments on commit 5d106b8

Please sign in to comment.