Retry netlink dump-interrupted errors in isRetryableError#182
Open
plamen-bardarov wants to merge 2 commits into
Open
Retry netlink dump-interrupted errors in isRetryableError#182plamen-bardarov wants to merge 2 commits into
plamen-bardarov wants to merge 2 commits into
Conversation
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.
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.
Problem
vishvananda/netlinkv1.3.1 changed how dump-interrupted netlink responses are surfaced: instead of returningunix.EINTRdirectly, the library now returns a customErrDumpInterruptedsentinel that does not implement theTemporary() boolinterface. The existingisRetryableErrorpredicate inlib/commonkeyed offTemporary(), so it silently stopped retrying interrupted dumps after the version bump.This broke retry coverage on the
InterfaceNameLookuppath (used bycni-wrapper-pluginandvxlan-policy-agent) without any test failures — the unit tests were injecting rawunix.EINTR(unix.Errno), which still implementsTemporary(), masking the regression.Fix
isRetryableErrorto checkerrors.Is(err, netlink.ErrDumpInterrupted)anderrors.Is(err, unix.EINTR)before falling back to theTemporary()interface check.netlink.ErrDumpInterruptedsentinel so the fix is locked in.Testing
Unit tests pass in the CI docker environment (
lib/common5/5,lib/interfacelookup8/8 including the new test).