fix(ci): kill stale platform-server before binding port
Some checks failed
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 14s
CI / Detect changes (pull_request) Successful in 35s
Lint curl status-code capture / Scan workflows for curl status-capture pollution (pull_request) Successful in 18s
E2E API Smoke Test / detect-changes (pull_request) Successful in 44s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 48s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 56s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 19s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 56s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m19s
Lint workflow YAML (Gitea-1.22.6-hostile shapes) / Lint workflow YAML for Gitea-1.22.6-hostile shapes (pull_request) Successful in 1m43s
Lint pre-flip continue-on-error / Verify continue-on-error flips have run-log proof (pull_request) Successful in 1m55s
lint-continue-on-error-tracking / lint-continue-on-error-tracking (pull_request) Successful in 2m25s
lint-required-context-exists-in-bp / lint-required-context-exists-in-bp (pull_request) Successful in 2m16s
sop-checklist / na-declarations (pull_request) N/A: qa-review
security-review / approved (pull_request) Failing after 52s
sop-checklist / all-items-acked (pull_request) Successful in 48s
gate-check-v3 / gate-check (pull_request) Failing after 1m7s
qa-review / approved (pull_request) Failing after 1m0s
sop-tier-check / tier-check (pull_request) Successful in 40s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 9s
CI / Platform (Go) (pull_request) Successful in 11s
CI / Canvas (Next.js) (pull_request) Successful in 11s
CI / Python Lint & Test (pull_request) Successful in 9s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 12s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 13s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 10s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2m1s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
CI / all-required (pull_request) Successful in 5s

Cancelling or timing out a workflow run leaves the platform-server
process alive — the "Stop platform" step is skipped.
The next run's ephemeral port probe (socket.bind(("", 0))) may receive
a stale port, or a zombie platform-server may linger on :8080.

Fix: unconditionally scan /proc for zombie platform-server processes
before the ephemeral port probe. comm truncation ("platform-server" →
"platform-serve", 15 chars) is handled; cmdline is verified before kill.
Uses only shell builtins + grep + kill — available on any Ubuntu runner.

Refs: internal#374, issue #1046

## Comprehensive testing performed
<!-- comprehensive-testing -->CI: Lint workflow YAML (Gitea-1.22.6-hostile shapes) , sop-tier-check , Block internal-flavored paths . YAML validated with python3 yaml.safe_load before commit.

## Local-postgres E2E run
<!-- local-postgres-e2e -->N/A: pure-workflow YAML change; no database schema, Go/Python code, or local Postgres harness paths touched.

## Staging-smoke verified or pending
<!-- staging-smoke -->scheduled post-merge canary; no server-side changes.

## Root-cause not symptom
<!-- root-cause -->Cancelled/timeout CI runs skip "Stop platform", leaving zombie platform-server on :8080. Ephemeral port picker may receive a TIME_WAIT port or a zombie on an ephemeral port may interfere.

## Five-Axis review walked
<!-- five-axis-review -->Correctness: /proc scan kills only platform-server (cmdline verified). Readability: self-contained with inline comments. Architecture: no server code change. Security: read-only scan, kill only exact binary match. Performance: O(n_procs), negligible.

## No backwards-compat shim / dead code added
<!-- no-backwards-compat -->Yes: additive kill step; no legacy paths or deprecated code.

## Memory/saved-feedback consulted
<!-- memory-consulted -->local memory: /proc comm field is TASK_COMM_LEN 16 - 1 = 15 chars. "platform-server" (16) → "platform-serve" (15). Must grep truncated form, verify with cmdline.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Molecule AI · infra-sre 2026-05-14 17:44:55 +00:00
parent 9b445366f6
commit c7ffa43166

Diff Content Not Available