Skip to content

fix(worker): Stop misreading a live NAT veth pair as missing - #1481

Merged
privateip merged 1 commit into
integration/galactic-workerfrom
fix/issue-1471
Nov 21, 2026
Merged

privateip merged 1 commit into
integration/galactic-workerfrom
fix/issue-1471

Conversation

@privateip

Copy link
Copy Markdown
Contributor

Fixes #1471, part of #1430.

Under CPU load, Worker's local module sometimes read an existing NAT veth pair as missing, reported it Pending, and on its next write would have deleted and recreated the live pair. The cause was the ethtool lookup of a veth's peer, which fails about once in 300,000 to 1,000,000 calls for a reason inside the netlink library that is still unproven (reproduction). The module and galactic-nat now read the peer from the link list they already fetch, with no ethtool call.

Test plan

  • New steady-state root test, under CPU stress: 10 of 30 runs failed before the fix and 30 of 30 pass after. Without stress it catches the failure only by chance.
  • Under the same stress, the three tests from the issue each pass 200 consecutive runs.
  • New unit tests check peer matching. The full root suites of both changed packages pass.
  • Lint, build and race unit tests pass. The YAML format check can't run in a git worktree, and this PR changes no YAML.

Local confirmed a NAT pair's peer, and a routed link's pod end, with
netlink.VethPeerIndex, which asks ethtool through two SIOCETHTOOL
ioctls. Under CPU load that call fails about once in 300,000 to
1,000,000 calls, returning "unexpected EOF". readPair then reported an
existing pair missing. Read marked it Pending ("not created yet"),
Plan wanted to write again, and Apply would have deleted and recreated
the live pair.

A veth reports its peer's ifindex as IFLA_LINK in the link dump Local
already reads, and carries IFLA_LINK_NETNSID only when the peer is in
another namespace. readPair now requires each end to name the other
from this namespace. The routed-link read, creation and handoff report
take the pod end's ifindex from the same attribute. galactic-nat's
tenantEndMAC finds the tenant end the same way.

TestSteadyStateRoot reads a ready rig and plans it 200 times, expecting
Ready and an empty plan each pass. Without CPU stress it catches the
old failure only by chance.

Fixes #1471
@privateip privateip self-assigned this Nov 21, 2026
@privateip
privateip marked this pull request as ready for review November 21, 2026 11:39
@privateip
privateip requested a review from a team as a code owner November 21, 2026 11:39
@privateip
privateip merged commit e9888da into integration/galactic-worker Nov 21, 2026
31 checks passed
@privateip
privateip deleted the fix/issue-1471 branch November 21, 2026 11:39
@privateip

Copy link
Copy Markdown
Contributor Author

Both first-pass reviewers returned a merge verdict.

pr-adversary: "VERDICT: merge. Nothing I checked disagrees with the PR body." It ran: gh pr view; git diff base...head; grep netlink in go.mod and the cached netlink source; sed kernel.go; gh pr checks. It did not run the stress or root suites.

pr-conventions-reviewer: "VERDICT: merge. No blocker; the only open point is a likely rebase against #1463 and #1480." It ran: gh pr view; git diff base...head; gh pr list --state open; gh pr diff 1480/1474/1463 hunks.

No findings needed a code change, so no commits were added. The two warnings are merge-order notes: #1463 and #1480 touch nearby code, and whichever PR merges second resolves the textual conflict.

CI: every check on the head completed with success or skipped, including the unit, root unit and end-to-end test jobs.

Merge method: merge commit, the default, because the base branch ruleset has no pull request rule. The ruleset carries no review requirement here, so auto-merge can complete without a human approval; with all checks green, the PR merged as soon as it was enabled.

privateip added a commit that referenced this pull request Nov 24, 2026
fix(worker): Stop misreading a live NAT veth pair as missing
privateip added a commit that referenced this pull request Nov 30, 2026
fix(worker): Stop misreading a live NAT veth pair as missing
privateip added a commit that referenced this pull request Dec 2, 2026
fix(worker): Stop misreading a live NAT veth pair as missing
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.

1 participant