]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mgr/ActivePyModules.cc: always release GIL before attempting to acquire a lock
authorCory Snyder <csnyder@iland.com>
Mon, 21 Dec 2020 14:33:22 +0000 (09:33 -0500)
committerCory Snyder <csnyder@iland.com>
Mon, 21 Dec 2020 14:57:03 +0000 (09:57 -0500)
commit0601b31a53a455f0b67c981460d198cb3a97f3de
tree4b9d34ee2824ed5045231fd615969376c2a06c06
parentb885dfe45589dd35d9f2c3e65dfaa8f3397c2d57
mgr/ActivePyModules.cc: always release GIL before attempting to acquire a lock

A thread that holds the GIL while attempting to acquire a mutex will cause a deadlock
if another thread owns the mutex and is waiting on the GIL. The GIL must not be treated
like an ordinary mutex since it may be preempted at any time or released when doing
blocking I/O. Such deadlocks are severe since they starve all threads from access to the
GIL and therefore prevent any Python code from running until the mgr process is restarted.

Fixes: https://tracker.ceph.com/issues/39264
Signed-off-by: Cory Snyder <csnyder@iland.com>
src/mgr/ActivePyModules.cc