Skip to content

Gate the network on Prepared, never on Programmed - #244

Merged
scotwells merged 4 commits into
mainfrom
fix/network-gate-programmed-deadlock
Aug 21, 2026
Merged

Gate the network on Prepared, never on Programmed#244
scotwells merged 4 commits into
mainfrom
fix/network-gate-programmed-deadlock

Conversation

@scotwells

@scotwells scotwells commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

The Network scheduling gate now waits for the data plane to be ready to receive a Pod, and still never waits for the attachment itself.

networkInterfaceClaimSatisfied becomes Bound + Allocated + Prepared. Prepared means the data plane's pre-Pod artifacts exist, so a Pod created now can be attached. It becomes true before any Pod exists, which is what makes waiting on it safe.

Programmed stays excluded, permanently, and the function now says why at length — the deadlock argument is the reason the two conditions exist separately. Programmed becomes true when the interface is attached at sandbox creation, and the infrastructure provider defers creating the Pod while any scheduling gate remains, so a gate waiting on Programmed waits on itself: no Pod, no attachment; no attachment, no Programmed. It reaches consumers through Instance.status.networkInterfaces[].conditions, which is already mirrored.

Two paired tests keep both halves honest: a claim with Programmed False or Unknown still releases the gate, and a claim with Prepared False or Unknown does not. Prepared also joins the conditions mirrored onto Instance status and the reasons surfaced when a claim is refused, so a stuck instance says why instead of sitting gated in silence.

The condition type comes from NSO rather than being repeated here as a string. A duplicated condition literal fails closed and quiet — rename it upstream and compute simply never finds the condition, reads it as not-True, and holds every networked instance with no error naming the cause.

Before this merges

The network-services-operator pin points at main, not a branch — datum-cloud/network-services-operator#393 has merged. The latest tag still predates the Prepared condition, so re-pin once a release carries it.

Do not merge until the VPC controller is deployed in every cell running the networking integration. Nothing writes Prepared today, so merging first leaves every networked instance gated indefinitely, with no error naming the cause.

Related

🤖 Generated with Claude Code

@scotwells scotwells changed the title Keep the Network scheduling gate off Programmed Gate the network on Prepared, never on Programmed Aug 21, 2026
@scotwells
scotwells requested a review from privateip August 21, 2026 00:49
@scotwells
scotwells marked this pull request as ready for review August 21, 2026 00:49
scotwells and others added 3 commits August 20, 2026 19:54
Programmed becomes true at sandbox creation, which a provider defers
while any gate remains, so gating on it deadlocks. Record why the gate
stays on Bound and Allocated, and add a test that a claim reporting
Programmed=False or Unknown still releases the gate.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Prepared reports that the data plane's pre-Pod artifacts exist, so a Pod
created now can be attached. Programmed only becomes true once that Pod's
sandbox exists, so gating on it waits on itself. The gate becomes
Bound + Allocated + Prepared, and Prepared joins the conditions mirrored
onto Instance status and the reasons surfaced on refusal.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A condition type duplicated as a string in two repos fails closed and
silent: rename it upstream and compute never finds the condition, reads
it as not-True, and gates every networked instance with nothing naming
the cause. Pin NSO to the commit carrying the constant and use it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@scotwells
scotwells force-pushed the fix/network-gate-programmed-deadlock branch from e8af524 to 34cd609 Compare August 21, 2026 00:55
…merged

datum-cloud/network-services-operator#393 is merged, so the pin no longer
targets an unmerged branch. The latest tag still predates the Prepared
condition, so this stays a main pseudo-version until a release carries it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@scotwells
scotwells merged commit 1fa20c5 into main Aug 21, 2026
10 checks passed
@scotwells
scotwells deleted the fix/network-gate-programmed-deadlock branch August 21, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants