]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mgr/ActivePyModules.cc: always release GIL before attempting to acquire a lock 38801/head
authorCory Snyder <csnyder@iland.com>
Mon, 21 Dec 2020 14:33:22 +0000 (09:33 -0500)
committerLaura Paduano <lpaduano@suse.com>
Thu, 7 Jan 2021 12:11:38 +0000 (13:11 +0100)
commitfb61eb43839108139197b48938b4f8a58109f635
treedc7fa57a9a40bb7f626abd7800e015877dd21fe2
parent79adcfe1c91d71a042ed33a77a29dea96f116e6e
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>
(cherry picked from commit 0601b31a53a455f0b67c981460d198cb3a97f3de)
src/mgr/ActivePyModules.cc