Skip to content

Commit

Permalink
remove process from cache after step_until_terminated
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Mar 4, 2021
1 parent 72505e9 commit 2b6ef68
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions plumpy/process_comms.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,10 @@ async def _launch(
asyncio.ensure_future(proc.step_until_terminated())
return proc.pid

await proc.step_until_terminated()
try:
await proc.step_until_terminated()
finally:
self._process_cache.pop(proc.pid, None)

return proc.future().result()

Expand Down Expand Up @@ -638,7 +641,10 @@ async def _continue(
asyncio.ensure_future(proc.step_until_terminated())
return proc.pid

await proc.step_until_terminated()
try:
await proc.step_until_terminated()
finally:
self._process_cache.pop(proc.pid, None)

return proc.future().result()

Expand Down

0 comments on commit 2b6ef68

Please sign in to comment.