Skip to content

Commit

Permalink
instance_pids if no pid file are not missing.
Browse files Browse the repository at this point in the history
This code says the instances we find that don't have pids, are missing.
This happens when we read metrics, and then know what the pids of the
flows were when it was last running.
An instance pid that doesn't have a matching file is actually a stray.
I think this code pre-dates strays. anyways what was happenning:

sr3 stop xx   # xx has current metrics file.
sr3 sanity
  # instances of xx are detected as "missing" because metrics present.
  # sanity therefore starts up xx when it should not.
  • Loading branch information
petersilva committed May 24, 2024
1 parent e6738cb commit 2bead5f
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions sarracenia/sr.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,13 +599,6 @@ def _find_missing_instances_dir(self, dir):
missing.append([c, cfg, i])
else:
missing.append([c, cfg, i])
if ( len(self.states[c][cfg]['instance_pids']) > 0 ) or ( len(missing) > 0 ) :
# look for instances that should be running, but no pid file exists.
for i in range(1, int(self.configs[c][cfg]['instances'])+1 ):
if not i in self.states[c][cfg]['instance_pids']:
if i not in self.procs:
if i != 0:
missing.append([c,cfg,i])
os.chdir(c_dir) # back to component dir containing configs
os.chdir(dir) # back to dir containing components

Expand Down

0 comments on commit 2bead5f

Please sign in to comment.