From 568a8220e0bfdafd4d3754dcbe0573325995ebe6 Mon Sep 17 00:00:00 2001 From: Reid Sunderland Date: Fri, 17 May 2024 15:51:07 +0000 Subject: [PATCH] Fix sanity not starting missing instances. Group effort fix from debugging session --- sarracenia/sr.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sarracenia/sr.py b/sarracenia/sr.py index 0859fcde6..de7ac2be2 100755 --- a/sarracenia/sr.py +++ b/sarracenia/sr.py @@ -1981,7 +1981,7 @@ def sanity(self): component_path = self._find_component_path(c) if component_path == '': continue - if self.configs[c][cfg]['status'] in ['stopped']: + if self.configs[c][cfg]['status'] in ['missing']: numi = self.configs[c][cfg]['instances'] for i in range(1, numi + 1): if pcount % 10 == 0: print('.', end='', flush=True) @@ -1992,9 +1992,9 @@ def sanity(self): print( f'\nfound hung {c}/{cfg}/{i} pid: {kill_pid}' ) kill_hung.append( kill_pid ) pcount += 1 - - print('killing hung processes... (no point in SIGTERM if it is hung)') + if (len(kill_hung) > 0) and not self.options.dry_run : + print('killing hung processes... (no point in SIGTERM if it is hung)') for pid in kill_hung: signal_pid(pid, signal.SIGKILL) time.sleep(5) @@ -2003,7 +2003,8 @@ def sanity(self): if pcount != 0: self._find_missing_instances() - self._clean_missing_proc_state() + if not self.options.dry_run: + self._clean_missing_proc_state() self._read_states() self._resolve() filtered_missing = []