From 1b637144a6bbbeb752f1a006ce0f7647b084783a Mon Sep 17 00:00:00 2001 From: Michael Fritch Date: Fri, 12 Jun 2020 08:24:16 -0600 Subject: [PATCH] cephadm: only SIGKILL once during timeout no need to continually SIGKILL a process that is already exiting Signed-off-by: Michael Fritch --- src/cephadm/cephadm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 3266c829f920..d5a5945471d1 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 -- 2.47.3