From: Kefu Chai Date: Thu, 30 Apr 2020 03:34:07 +0000 (+0800) Subject: mgr: do not load disabled modules X-Git-Tag: v16.1.0~2453^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F34846%2Fhead;p=ceph.git mgr: do not load disabled modules an option named "mgr_disabled_modules" is added in this change to prevent mgr from loading modules listed in this option. because mgr loads *all* modules found in the configured path, and per https://tracker.ceph.com/issues/45147, python subinterpreter could hang when loading numpy, so this behavior practically creates a deadlock in mgr. this issue is found when mgr uses python3.8 runtime. in development environment, it'd be inconvenient to disable the offending mgr module without changing the source code, even if we can choose to not install them, for instance, the enduser can workaround this issue by uninstalling `ceph-mgr-diskprediction-local`. an option would be useful in this case, so we can add the module to the list before mgr tries to load it. as this issue is found with python3.8 + diskprediction_local (numpy), so this mgr module is disabled by default if mgr is compiled with python3.8 runtime. Fixes: https://tracker.ceph.com/issues/45147 Signed-off-by: Kefu Chai --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f7e86414c2d..fa00d1316bcc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -442,6 +442,11 @@ if(WITH_MGR) set(MGR_PYTHON_LIBRARIES ${Python3_LIBRARIES}) set(MGR_PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR}) set(MGR_PYTHON_VERSION_MINOR ${Python3_VERSION_MINOR}) + # https://tracker.ceph.com/issues/45147 + if(Python3_VERSION VERSION_GREATER_EQUAL 3.8) + set(MGR_DISABLED_MODULES "diskprediction_local") + message(STATUS "mgr module disabled for ${Python3_VERSION}: ${MGR_DISABLED_MODULES}") + endif() # Boost dependency check deferred to Boost section endif(WITH_MGR) diff --git a/src/common/options.cc b/src/common/options.cc index be1e955ab51e..c78d9b69d759 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -5169,6 +5169,20 @@ std::vector