Skip to content

Commit

Permalink
Explicitly close FluxExecutor ZMQ socket after use
Browse files Browse the repository at this point in the history
This is to avoid a race-prone garbage collection driven shutdown
of ZMQ - see issue #3484 for more details.
  • Loading branch information
benclifford committed Jul 10, 2024
1 parent 0364bab commit 2b0c63a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions parsl/executors/flux/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,17 +300,19 @@ def submit(


def _submit_wrapper(
submission_queue: queue.Queue, stop_event: threading.Event, *args, **kwargs
submission_queue: queue.Queue, stop_event: threading.Event, socket, *args, **kwargs
):
"""Wrap the ``_submit_flux_jobs`` function in a try/except.
If an exception is thrown, error out all submitted tasks.
"""
try:
_submit_flux_jobs(submission_queue, stop_event, *args, **kwargs)
_submit_flux_jobs(submission_queue, stop_event, socket, *args, **kwargs)
except Exception as exc:
_error_out_jobs(submission_queue, stop_event, exc)
raise
finally:
socket.close()


def _error_out_jobs(
Expand Down

0 comments on commit 2b0c63a

Please sign in to comment.