Skip to content

Commit

Permalink
Check process lineage before join (lava-nc#177)
Browse files Browse the repository at this point in the history
Signed-off-by: Marcus G K Williams <168222+mgkwill@users.noreply.github.com>
  • Loading branch information
mgkwill committed Feb 15, 2022
1 parent 1afbf35 commit 63cb4ca
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
AbstractRuntimeServiceBuilder

import multiprocessing as mp
import os
from multiprocessing.managers import SharedMemoryManager
import traceback

Expand Down Expand Up @@ -76,7 +77,8 @@ def build_actor(self, target_fn: ty.Callable, builder: ty.Union[
def stop(self):
"""Stops the shared memory manager"""
for actor in self._actors:
actor.join()
if actor._parent_pid == os.getpid():
actor.join()

self._smm.shutdown()

Expand Down

0 comments on commit 63cb4ca

Please sign in to comment.