From: Kefu Chai Date: Thu, 30 Apr 2020 03:34:07 +0000 (+0800) Subject: mgr: do not load disabled modules X-Git-Tag: v15.2.14~54^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fc9a70cb908c335fb93c82b031c3d0bce4e36477;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 (cherry picked from commit 067adbf9a032b5de793fd0b41b071f24f075270a) --- diff --git a/CMakeLists.txt b/CMakeLists.txt index a2d34ee97dfb..fc67de963e47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -440,6 +440,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 b8cc55ef982b..85f4203be368 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -5256,6 +5256,20 @@ std::vector