siso: make sure we don't try to kill process 0 if it gets returned.

Bug: b/455433899
Change-Id: I8d4e6df5a374e97c0d790fe608964c6f6a6a6964
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7220270
Auto-Submit: Alex Ovsienko <ovsienko@google.com>
Commit-Queue: Alex Ovsienko <ovsienko@google.com>
Commit-Queue: Junji Watanabe <jwata@google.com>
Reviewed-by: Junji Watanabe <jwata@google.com>
This commit is contained in:
Alex Ovsienko
2025-12-04 21:36:50 -08:00
committed by LUCI CQ
parent e96cff71c9
commit f2ac99f082
2 changed files with 6 additions and 3 deletions

View File

@@ -83,8 +83,9 @@ def _kill_collector() -> bool:
continue
if parts[1] != f'127.0.0.1:{_OTLP_HEALTH_PORT}':
continue
pid = parts[-1]
pids.append(pid)
pids.append(int(parts[-1]))
# Windows may return processes with PID 0, which is definitely not what we want.
pids = [pid for pid in pids if pid != 0]
if not pids:
print(f"Warning: no processes detected taking {_OTLP_HEALTH_PORT}.",
file=sys.stderr)