Skip to content

Retry netlink dump-interrupted errors in isRetryableError#182

Open
plamen-bardarov wants to merge 2 commits into
cloudfoundry:developfrom
plamen-bardarov:fix/eintr-retry-predicate
Open

Retry netlink dump-interrupted errors in isRetryableError#182
plamen-bardarov wants to merge 2 commits into
cloudfoundry:developfrom
plamen-bardarov:fix/eintr-retry-predicate

Conversation

@plamen-bardarov

Copy link
Copy Markdown
Contributor

Note: This PR was authored with AI assistance (Claude Code).

Problem

vishvananda/netlink v1.3.1 changed how dump-interrupted netlink responses are surfaced: instead of returning unix.EINTR directly, the library now returns a custom ErrDumpInterrupted sentinel that does not implement the Temporary() bool interface. The existing isRetryableError predicate in lib/common keyed off Temporary(), so it silently stopped retrying interrupted dumps after the version bump.

This broke retry coverage on the InterfaceNameLookup path (used by cni-wrapper-plugin and vxlan-policy-agent) without any test failures — the unit tests were injecting raw unix.EINTR (unix.Errno), which still implements Temporary(), masking the regression.

Fix

  • Update isRetryableError to check errors.Is(err, netlink.ErrDumpInterrupted) and errors.Is(err, unix.EINTR) before falling back to the Temporary() interface check.
  • Add a regression test that injects the real netlink.ErrDumpInterrupted sentinel so the fix is locked in.

Testing

Unit tests pass in the CI docker environment (lib/common 5/5, lib/interfacelookup 8/8 including the new test).

vishvananda/netlink v1.3.1 returns a custom ErrDumpInterrupted sentinel
for NLM_F_DUMP_INTR responses instead of unix.EINTR. The new error type
does not implement Temporary(), so the existing predicate stopped
retrying dump-interrupted errors silently — every RetryWithBackoff
caller (InterfaceNameLookup, used by cni-wrapper-plugin and
vxlan-policy-agent) lost retry coverage.

Update isRetryableError to also match netlink.ErrDumpInterrupted (and
unix.EINTR explicitly, for defense in depth) before falling back to the
Temporary() interface check. Add a regression test that injects the
real netlink.ErrDumpInterrupted sentinel — the existing unix.EINTR test
masked the bug because unix.Errno still implements Temporary().

The pkg/errors import is replaced with the stdlib equivalent since both
errors.As and errors.Is are needed and stdlib provides them directly.
Reverts the stdlib errors swap from the previous commit — that change
was unrelated to the EINTR fix and inconsistent with the rest of the
codebase.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant