From: Rishabh Dave Date: Mon, 7 Dec 2020 16:33:31 +0000 (+0530) Subject: qa: set "shell" to False for run_ceph_w() X-Git-Tag: v17.1.0~2514^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=df88ec382221e0c1a0a6e66961f3fc1519f95986;p=ceph.git qa: set "shell" to False for run_ceph_w() Setting shell to True in call to run() in LocalCephManager.run_ceph_w() leads to a crash when self.subproc.communicate() is executed for the process created by running "ceph -w". Signed-off-by: Rishabh Dave --- diff --git a/qa/tasks/ceph_manager.py b/qa/tasks/ceph_manager.py index fbdf0da8e887..0f925241d80b 100644 --- a/qa/tasks/ceph_manager.py +++ b/qa/tasks/ceph_manager.py @@ -1436,7 +1436,14 @@ class CephManager: kwargs['check_status'] = False return self.run_cluster_cmd(**kwargs).exitstatus - def run_ceph_w(self, watch_channel=None): + # XXX: Setting "shell" to True for LocalCephManager.run_ceph_w(), doesn't + # work with vstart_runner.py; see https://tracker.ceph.com/issues/49644. + # shell=False as default parameter is just to maintain compatibility + # between interfaces of CephManager.run_ceph_w() and + # LocalCephManager.run_ceph_w(). This doesn't affect how "ceph -w" process + # is launched by this method since this parameters remains unused in + # this method. + def run_ceph_w(self, watch_channel=None, shell=False): """ Execute "ceph -w" in the background with stdout connected to a BytesIO, and return the RemoteProcess. diff --git a/qa/tasks/ceph_test_case.py b/qa/tasks/ceph_test_case.py index 23cf4839f63f..58e78a1452ca 100644 --- a/qa/tasks/ceph_test_case.py +++ b/qa/tasks/ceph_test_case.py @@ -106,7 +106,10 @@ class CephTestCase(unittest.TestCase): return found def __enter__(self): - self.watcher_process = ceph_manager.run_ceph_w(watch_channel) + # XXX: For reason behind setting "shell" to False, see + # https://tracker.ceph.com/issues/49644. + self.watcher_process = ceph_manager.run_ceph_w(watch_channel, + shell=False) def __exit__(self, exc_type, exc_val, exc_tb): if not self.watcher_process.finished: diff --git a/qa/tasks/vstart_runner.py b/qa/tasks/vstart_runner.py index f0bc0b8a50d6..d62dc41c9863 100644 --- a/qa/tasks/vstart_runner.py +++ b/qa/tasks/vstart_runner.py @@ -964,7 +964,9 @@ class LocalCephManager(CephManager): """ return LocalRemote() - def run_ceph_w(self, watch_channel=None): + # XXX: For reason behind setting "shell" to False, see + # https://tracker.ceph.com/issues/49644. + def run_ceph_w(self, watch_channel=None, shell=False): """ :param watch_channel: Specifies the channel to be watched. This can be 'cluster', 'audit', ... @@ -974,7 +976,8 @@ class LocalCephManager(CephManager): if watch_channel is not None: args.append("--watch-channel") args.append(watch_channel) - proc = self.controller.run(args=args, wait=False, stdout=StringIO()) + proc = self.controller.run(args=args, wait=False, stdout=StringIO(), + shell=shell) return proc def run_cluster_cmd(self, **kwargs):