Skip to content

Commit

Permalink
Guard when workerBarrier is None (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
neilflood authored Oct 19, 2024
1 parent baef954 commit 2a84212
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion rios/cmdline/rios_computeworker.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ def riosRemoteComputeWorker(workerID, host, port, authkey):
blockListByWorker = dataChan.workerInitData.get('blockListByWorker', None)
blockList = blockListByWorker[workerID]

if not controls.concurrency.singleBlockComputeWorkers:
if (not controls.concurrency.singleBlockComputeWorkers and
hasattr(workerBarrier, 'wait')):
# Wait at the barrier, so nothing proceeds until all workers have had
# a chance to start
computeBarrierTimeout = controls.concurrency.computeBarrierTimeout
Expand Down
3 changes: 2 additions & 1 deletion rios/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,8 @@ def shutdown(self):
"""
if hasattr(self, 'server'):
self.server.stop_event.set()
self.workerBarrier.abort()
if self.workerBarrier is not None:
self.workerBarrier.abort()
futures.wait([self.serverThread])
self.threadPool.shutdown()

Expand Down

0 comments on commit 2a84212

Please sign in to comment.