Skip to content

Commit 2b6ef68

Browse files
committed
remove process from cache after step_until_terminated
1 parent 72505e9 commit 2b6ef68

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

plumpy/process_comms.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,10 @@ async def _launch(
602602
asyncio.ensure_future(proc.step_until_terminated())
603603
return proc.pid
604604

605-
await proc.step_until_terminated()
605+
try:
606+
await proc.step_until_terminated()
607+
finally:
608+
self._process_cache.pop(proc.pid, None)
606609

607610
return proc.future().result()
608611

@@ -638,7 +641,10 @@ async def _continue(
638641
asyncio.ensure_future(proc.step_until_terminated())
639642
return proc.pid
640643

641-
await proc.step_until_terminated()
644+
try:
645+
await proc.step_until_terminated()
646+
finally:
647+
self._process_cache.pop(proc.pid, None)
642648

643649
return proc.future().result()
644650

0 commit comments

Comments
 (0)