diff --git a/docs/changelog.rst b/docs/changelog.rst index 62f77071..3c7350b5 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -298,6 +298,10 @@ Core Library was configured. This would lead to connection timeouts due to the hung response. +* `#414 `_, + `#425 `_: avoid deadlock of forked + children by reinitializing the :mod:`mitogen.service` pool lock. + * `#416 `_: around 1.4KiB of memory was leaked on every RPC, due to a list of strong references keeping alive any handler ever registered for disconnect notification. diff --git a/mitogen/fork.py b/mitogen/fork.py index 3e3a98a9..8636bd13 100644 --- a/mitogen/fork.py +++ b/mitogen/fork.py @@ -85,6 +85,10 @@ def on_fork(): mitogen.core.Latch._on_fork() mitogen.core.Side._on_fork() + mitogen__service = sys.modules.get('mitogen.service') + if mitogen__service: + mitogen__service._pool_lock = threading.Lock() + def handle_child_crash(): """