]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: only SIGKILL once during timeout
authorMichael Fritch <mfritch@suse.com>
Fri, 12 Jun 2020 14:24:16 +0000 (08:24 -0600)
committerSebastian Wagner <sebastian.wagner@suse.com>
Tue, 14 Jul 2020 09:39:06 +0000 (11:39 +0200)
no need to continually SIGKILL a process that is already exiting

Signed-off-by: Michael Fritch <mfritch@suse.com>
(cherry picked from commit 1b637144a6bbbeb752f1a006ce0f7647b084783a)

src/cephadm/cephadm

index d8f16ef0d3df1a74b3bb68bb93a928e5dfb54b42..8f25d9ae66d243589c9fd0c2f679719386fb2f61 100755 (executable)
@@ -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