fix(ci): give falcon-hello a per-run port pair — fixed ports collide - #349
Merged
Conversation
The demo binds a FIXED UDP port pair (default 14700/14701). Several of these jobs can land on the SAME self-hosted runner concurrently, and the second one dies: error: bind 127.0.0.1:14700: Address already in use (os error 98) error: bind 127.0.0.1:14701: Address already in use (os error 98) Observed 2026-08-08 after four PRs were refreshed together. It is not rare — it happens whenever more than one PR is updated at once, which is routine when branch protection is strict and every merge puts the rest BEHIND. WHY IT IS WORTH FIXING RATHER THAN RE-RUNNING: it surfaces as a red REQUIRED check on a PR that cannot possibly have caused it — #342 changed a single workflow file — so it reads as a real regression and costs a diagnosis cycle. Worse, the "fix" that works is hitting re-run, which is exactly the habit that gets a genuine failure clicked through. The script ALREADY honours FALCON_HELLO_PORT_BASE (scripts/falcon-hello-demo.sh line 28). CI simply never set it. Derive a per-run base from GITHUB_RUN_ID. Stepping by 2 is load-bearing: the demo uses base AND base+1, so consecutive bases would still overlap on one port. base = 20000 + (GITHUB_RUN_ID % 10000) * 2 -> 20000..39998 pair = base, base+1 -> 20000/20001 .. 39998/39999 consecutive run ids differ by 2 -> no shared port GITHUB_RUN_ID is injected by Actions as a plain env var, so nothing is interpolated into the run: block. Verified locally end-to-end, not merely by reading the script: $ FALCON_HELLO_PORT_BASE=20246 bash scripts/falcon-hello-demo.sh [falcon-hello-demo] launching gcs on 127.0.0.1:20246 exit=0 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HvusAXYbHLyv3uTzfBcMbG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A red required check on a PR that could not have caused it.
Symptom
Hit on #342 — which changes one workflow file and cannot affect a UDP demo.
mainwas green at the same commit range, so the failure was environmental.Cause
falcon-hellobinds a fixed UDP port pair (default14700/14701). Several of these jobs can land on the same self-hosted runner concurrently. That is not a rare race: it happens whenever more than one PR is updated at once, which is routine here because branch protection isstrict— every merge puts the remaining PRsBEHINDand they all get refreshed together. I triggered it by updating four PRs in one go.Why fix rather than re-run
It presents as a genuine regression on an unrelated PR, so it costs a diagnosis cycle. And the thing that "works" is hitting re-run on a red gate — which is precisely the habit that gets a real failure clicked through.
Fix
scripts/falcon-hello-demo.shalready honoursFALCON_HELLO_PORT_BASE(line 28). CI just never set it.Stepping by 2 is load-bearing — the demo uses
baseandbase+1, so consecutive bases would still collide on one port.GITHUB_RUN_IDis injected by Actions as a plain env var, so nothing is interpolated into therun:block.Verified end-to-end, not by reading
Port range checked (20000–39999, valid), consecutive run ids confirmed 2 apart, YAML parses.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HvusAXYbHLyv3uTzfBcMbG