From: Michael Fritch Date: Fri, 12 Jun 2020 14:24:16 +0000 (-0600) Subject: cephadm: only SIGKILL once during timeout X-Git-Tag: v15.2.5~147^2~49 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d21636b91c6184917ecac77d8ed76d52372c28f0;p=ceph.git cephadm: only SIGKILL once during timeout no need to continually SIGKILL a process that is already exiting Signed-off-by: Michael Fritch (cherry picked from commit 1b637144a6bbbeb752f1a006ce0f7647b084783a) --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index d8f16ef0d3df..8f25d9ae66d2 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -765,9 +765,10 @@ def call(command, # type: List[str] end_time = start_time + timeout while not stop: if end_time and (time.time() >= end_time): - logger.info(desc + ':timeout after %s seconds' % timeout) stop = True - process.kill() + if process.poll() is None: + logger.info(desc + ':timeout after %s seconds' % timeout) + process.kill() if reads and process.poll() is not None: # we want to stop, but first read off anything remaining # on stdout/stderr