Merge the last two buildtest-outage fix PRs (gossip pre-join-retry + refcnt regression test) once the gossip fix de-flakes the gate
Written: 2026-07-19 ~22:33 UTC by Claude (supervisor session).
RE-VERIFY banner: Everything below is a write-time snapshot. Before acting, re-verify each PR with
gh pr view <n> --repo <owner>/<repo> --json state,mergeStateStatus,statusCheckRollup,mergedAt, re-read the
gossip fix PR's CI, and check /runs at https://buildtest.kotlin.build/runs. A fresh query always wins.
Mission
Finish the 2026-07-19 buildtest.kotlin.build outage cleanup: land the final two fix PRs on UrlResolver main.
/runs is already reliable and the root causes are fixed/deployed; only the merge of two PRs remains, and it
is gated by a flaky CI check that PR #809 fixes.
Current state (verified 22:33 UTC)
/runs is reliable under normal load (sub-second). The outage is resolved.
- Merged already this session:
- Gossip-leak + non-serializing dispatcher lock: https://github.com/CodexCoder21Organization/UrlResolver/pull/803 (resolver 0.0.641, on main)
- Droplet reaper-leak fix: https://github.com/CodexCoder21Organization/BuildTestEmbedded/pull/348 (merged 14:27Z, deployed)
- Open — the two that still need to land:
- Gossip pre-join-retry fix: https://github.com/CodexCoder21Organization/UrlResolver/pull/809 —
OPEN,
merge BLOCKED on its own CI (running). Branch fix/bootstrap-prejoin-exchange-retry, head 051c939f
(pushed). This is the KEY unblocker (see below). My review (final + adversarial) PASSED.
- Refcnt regression-test PR: https://github.com/CodexCoder21Organization/UrlResolver/pull/807 —
OPEN,
merge CLEAN, my review passed. It has been evicted from the merge queue 4× because the required
bld-build check flakes on stressTestImmediateGossipSharingReliability. #809 fixes that flake.
The chain (what was found and done)
- The final blocker is a flaky required check (
bld-build) failing ~1/10 on
foundation.url.resolver.stressTestImmediateGossipSharingReliability ("all 10 clients discover all 3
services immediately after joining"). It is a pre-existing, repo-wide flake (fails intermittently on
many recent main commits, not introduced by our PRs). Blind retrying #807 through the queue is futile
(0/4 — do NOT keep re-enqueuing).
- Root-caused (via a codex agent) to a real gossip-discovery bug:
sendPeerExchangeAndReadResponse
(and its async variant) in src/foundation/url/resolver/UrlResolver.kt returned an empty list on a
transport/protocol FAILURE, indistinguishable from a valid empty response. The caller then recorded the
peer in recentlyExchangedPeers and suppressed the join-time retry, so a node whose bootstrap pre-join
exchange failed transiently came up blind to services — the flake.
- Fix (#809): both methods now return
List<PeerInfo>? — null on failure; callers ?: return /
?: return false early WITHOUT recording recentlyExchangedPeers, so the retry is preserved. Also bumps
resolver self-version 0.0.641 → 0.0.642 with a changelog entry, and adds a deterministic reproducer test
tests/testJoinNetworkRetriesBootstrapAfterFailedPreJoinExchange.kts.
- Fail-first proven: the deterministic connection-refusal reproducer failed 10/10 before the fix and
passed 10/10 after. Adversarial check: the two (and only two) call sites both handle the new
null;
no other callers → no NPE risk. Review is clean.
Next steps (in order)
- Drive #809 to MERGED. Its own merge-queue run includes the fixed test, so it should clear the gate.
Watch with build-watchman:
coursier launch buildwatchman:build-watchman:0.0.12 -r https://kotlin.directory -- --repo CodexCoder21Organization/UrlResolver --pr 809 --to-merged (a tracked instance bo3fapend was
running in the original session but that session is ending). If #809's own run flakes on the same test
BEFORE the fix takes effect in-queue, just re-enqueue once — the fix makes it deterministic.
- After #809 merges → main's
bld-build is de-flaked. Then rebase
https://github.com/CodexCoder21Organization/UrlResolver/pull/807 on the new main and re-enqueue it; it
should now clear the queue. NOTE: #807 also bumps to 0.0.642 (a redundant re-release) — since #809 now owns
0.0.642 with real content, #807 will conflict on build.kts; resolve by either dropping #807's version
bump (keep only its test) or bumping it to 0.0.643.
- Reconcile the two stale consumer-bump PRs (leftovers from an earlier tests-skipped refcnt attempt):
https://github.com/CodexCoder21Organization/BuildTestWui/pull/134 (
CLEAN) and
https://github.com/CodexCoder21Organization/BuildTestServerService/pull/229 (DIRTY — has conflicts).
Decide whether they're still needed (the resolver/protocol fixes are already on main / deployed) — likely
close #229 and re-cut if a consumer bump is actually wanted.
- Confirm
/runs still reliable; then the outage cleanup is fully DONE.
Reusable / operational knowledge
- codex is UNAVAILABLE until ~Jul 25 (hit its usage limit: "try again at Jul 25th, 2026 3:24 AM"). Until
then you cannot delegate to codex gpt-5.6-sol — do reviews/implementation in-loop or wait.
- The merge queue requires BOTH
bld-build AND kotlin.build (remote) (ALLGREEN); bld-build is a
GitHub Actions job (~60-90 min) whose step 7 "Run tests" is where the gossip flake bites. kotlin.build (remote) is the buildtest run. build-watchman can't measure bld-build (no buildtest run URL) — inspect it
via gh api repos/.../actions/runs/<id>/jobs.
- Do NOT blind-retry the queue — a flaky required check is a flake to fix, not to re-run (this cost hours).
- Deeper root cause still open (handed off separately): the buildtest host / ContainerNursery CPU-cost
makes
/runs fragile under load spikes (load hit 40-63 during this session; /runs briefly timed out). The
WUI-heap bump was a stopgap. Also today: two buildtest-CI infra failures (a node-level all-shard wedge, and a
resume-after-service-restart that marked 1040 tests failed with empty messages) — both traced to the
overloaded/unstable CI host; a challenge was filed re: kompile stale-maven build-rule cache.
- Fix working tree:
/code/workspace/UrlResolver-gossipflake, branch fix/bootstrap-prejoin-exchange-retry.
- Host:
ssh -p 23 root@198.199.106.165; JDK 21 at /usr/lib/jvm/java-21-openjdk-amd64; coursier at ~/bin/coursier.