review fixes: relaunch test without pgrep, clear stale marker at start, VERSION 2026.11.10
- test-haproxy-supervisor-relaunch.py used `pgrep -P`, which the image does not ship (no procps): the image build failed with FileNotFoundError in 3 of the 4 real-haproxy tests. Children are now read from /proc. - haproxy-supervisor.sh: clear /tmp/haproxy-restarting at start-up. A supervisor SIGKILLed mid-recovery (docker restart) runs no EXIT trap and /tmp survives a restart, so the marker would otherwise go stale. - VERSION 2026.11.10: merging to main publishes :<VERSION>; 2026.11.9 is already published and must not be overwritten with different content. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
This commit is contained in:
1 parent
6df8d4b332
commit
4ced47941d
3 files changed
+19
-4
No files matched your search
@@ -15,7 +15,7 @@ exits 134). Asserts:
|
||||
* a second master is never started while one is running,
|
||||
* an invalid on-disk config falls back to ensure_haproxy.py (python stub).
|
||||
|
||||
Needs a real `haproxy`, `pidof`, `bash`, `timeout`. Skips (exit 0, loudly)
|
||||
Needs a real `haproxy`, `pidof`, `bash`, `timeout` (no procps: children are read from /proc). Skips (exit 0, loudly)
|
||||
when haproxy is not installed, so it is meaningful in the image build (where
|
||||
validate-rendered-config.py also needs the binary) and on a dev box with haproxy.
|
||||
"""
|
||||
@@ -69,8 +69,19 @@ def _master_pids():
|
||||
|
||||
|
||||
def _worker_of(master):
|
||||
r = subprocess.run(['pgrep', '-P', str(master)], stdout=subprocess.PIPE, text=True)
|
||||
return [int(x) for x in r.stdout.split()]
|
||||
"""Children of `master` from /proc (the image has no procps/pgrep)."""
|
||||
out = []
|
||||
for name in os.listdir('/proc'):
|
||||
if not name.isdigit():
|
||||
continue
|
||||
try:
|
||||
with open('/proc/%s/stat' % name) as fh:
|
||||
ppid = int(fh.read().rsplit(')', 1)[1].split()[1])
|
||||
except (OSError, ValueError, IndexError):
|
||||
continue
|
||||
if ppid == master:
|
||||
out.append(int(name))
|
||||
return sorted(out)
|
||||
|
||||
|
||||
@unittest.skipUnless(HAPROXY, 'haproxy binary not installed')
|
||||
|
||||
Reference in new issue
Block a user