From: Sage Weil Date: Sat, 7 Dec 2019 21:34:59 +0000 (-0600) Subject: mgr/diskprediction_local: import scipy early to fix self-test deadlock X-Git-Tag: v15.1.0~600^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b9dea87ff1d39d0b9ba2ab469852b78aaa49529b;p=ceph.git mgr/diskprediction_local: import scipy early to fix self-test deadlock We are seeing a hang on centos7 (but not ubuntu 18.04) from from .predictor import get_diskfailurepredictor_path in _predict_life_expentancy. Doing that same predictor import at the top of the file doesn't help--it hangs right when the diskpredictor_local module is loaded. Commenting out the import scipy in predictor.py avoids the hang. I'm not sure why, but doing the full scipy import here appears to work around the problem. Fixes: https://tracker.ceph.com/issues/42764 Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/diskprediction_local/module.py b/src/pybind/mgr/diskprediction_local/module.py index 24f92c2c28a8..de21a948a488 100644 --- a/src/pybind/mgr/diskprediction_local/module.py +++ b/src/pybind/mgr/diskprediction_local/module.py @@ -9,6 +9,14 @@ import time from mgr_module import MgrModule, CommandResult +# Importing scipy early appears to avoid a future deadlock when +# we try to do +# +# from .predictor import get_diskfailurepredictor_path +# +# in a command thread. See https://tracker.ceph.com/issues/42764 +import scipy + TIME_FORMAT = '%Y%m%d-%H%M%S' TIME_DAYS = 24*60*60