-
Notifications
You must be signed in to change notification settings - Fork 791
fix: check nlmsghdr flags for interrupt #925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
fail if NLM_F_DUMP_INTR flag is set Signed-off-by: adrianc <adrianc@nvidia.com>
adrianchiris
commented
Nov 12, 2023
// < code which needs to be executed in specific netns> | ||
// } | ||
// | ||
// func jobAt(...) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while unrelated, linter keeps fixing this because of style issues.
this check is similar to what is perfomed in libmnl[1] |
LGTM |
This was referenced Aug 30, 2024
This was referenced Sep 9, 2024
fasaxc
added a commit
to fasaxc/calico
that referenced
this pull request
Jan 29, 2025
Hunch is that the change in vishvananda/netlink#1018, will prevent EBUSY by draining the remaining messages from the kernel before returning. Before vishvananda/netlink#925, all messages would be read but the "interrupted" flag was ignored. That PR made it so that the dump would return early, but that would leave some messages unconsumed. There was logic elsewhere to discard these messages, but the kernel has a check for "dump in progress" at the start of a new dump and it returns EBUSY in that case: ``` int __netlink_dump_start(struct sock *ssk, struct sk_buff *skb, const struct nlmsghdr *nlh, struct netlink_dump_control *control) { ... mutex_lock(&nlk->nl_cb_mutex); /* A dump is in progress... */ if (nlk->cb_running) { ret = -EBUSY; goto error_unlock; } ``` I wasn't able to trace the exact path through the kernel code to verify when cb_running would be set, or that the error would be returned on the NLMSG_DONE as we see here but it seemed like a solid bet.
This was referenced Jan 29, 2025
martinkennelly
added a commit
to martinkennelly/ovn-kubernetes-1
that referenced
this pull request
Jul 19, 2025
…andanda/netlink ..that may return EINTR. Fixes: ovn-kubernetes#5358 A change to the vishvananda/netlink package (vishvananda/netlink#925 in v1.2.1) exposes NLM_F_DUMP_INTR in some netlink responses as an EINTR error return but also doesn't return any data therefore all we can do is retry and netlink safe provides this with wrappers to certain netlink fn. This has been causing failures in some unit tests that interact with netlink. Retry the requests on EINTR, up to five times, Also, add RuleList to the the API and switch IP rule manager to use this. The reason it wasnt done before is ip rule manager doesn't fake out netlink for testing. Signed-off-by: Martin Kennelly <mkennell@redhat.com>
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.
fail if NLM_F_DUMP_INTR flag is set