Skip to content

Commit 953e818

Browse files
committed
copy of pr3285 drain fix
1 parent 66c90d6 commit 953e818

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

parsl/executors/high_throughput/process_worker_pool.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,14 +335,17 @@ def pull_tasks(self, kill_event):
335335
self.heartbeat_to_incoming()
336336
last_beat = time.time()
337337

338-
if self.drain_time and time.time() > self.drain_time:
338+
if time.time() > self.drain_time:
339339
logger.info("Requesting drain")
340340
self.drain_to_incoming()
341-
self.drain_time = None
342341
# This will start the pool draining...
343342
# Drained exit behaviour does not happen here. It will be
344343
# driven by the interchange sending a DRAINED_CODE message.
345344

345+
# now set drain time to the far future so we don't send a drain
346+
# message every iteration.
347+
self.drain_time = float('inf')
348+
346349
poll_duration_s = max(0, next_interesting_event_time - time.time())
347350
socks = dict(poller.poll(timeout=poll_duration_s * 1000))
348351

0 commit comments

Comments
 (0)