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
Improves the error logs during the bpf maps updating #16034
Conversation
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.
I appreciate the effort to improve the errors in Cilium, as some of them a can be quite confusing. However, I noticed several issues with this PR as-is:
- Please use a spellchecker.
- Syscall library is deprecated
- ENOENT message looks incorrect
- E2BIG is assuming LB map but this is a generic function, it doesn't make sense to add such specific instructions in this generic code.
- EINVAL, EPERM, ENOMEM adds no new information vs. the canonical string for that error
- The default looks like it will hide the real error, which is worse than having a confusing error.
The current code also embeds the underlying error as a string, but it should wrap the error instead in all new code (%w
).
@joestringer thank you for your review.
Oki.
I don't think so. Here I make the assumption that the user is trying to update an element that doesn't exist in the map. No?
I am aware of that. That is why I added a condition to the specific instruction. Unless we have a way to retrieve the map name from it ID. Do we?
I will keep the canonical message in these cases.
Here too, I will keep the canonical message. |
The code says:
"the element already exist" is not the same as "the element doesn't exist". Incidentally also, this error can only happen if the caller passes flags=
Maybe not today. Depending on how comprehensively you want to solve this problem for various map types, you could either add code higher up the stack where the code is specific to LB map (eg by unwrapping the error and checking whether it matches |
5914a61
to
ae42fb2
Compare
|
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.
Thanks for the patch! Please find some comments below.
fd282a8
to
c7cc270
Compare
@kkourt thanks for your review. The PR is updated with your suggestion. |
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.
Thanks! LGTM, assuming all the other concerns are resolved.
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.
Thanks!
test-me-please |
@elfadel it seems like the unit tests are failing:
|
@aanm oki. I will fix it as soon as possible and make a new commit |
972909c
to
f74b8f0
Compare
test-me-please |
@elfadel could you please rebase against the latest master? The base commit for this branch is quite old, and this may hint at why the CI is so unhappy with the PR right now. |
@joestringer Oki. |
Sorry, there was another change merged into the tree (#16631) that requires all PRs to be rebased once more, otherwise some of the CI jobs will fail. One more time? Then we can run the tests again. |
Done ! |
test-me-please |
@elfadel When I click through to the commit of your PR (https://github.com/cilium/cilium/commits/e335addcc806d01362fcebe951f6217cd03cf64d), it shows as being based still on old code. Can you try pulling in the latest cilium/cilium repo code again and rebasing on top of master? |
Oki @joestringer, I will proceed like that and make a new commit as soon as possible |
Fixes: cilium#15864 Signed-off-by: El-Fadel Bonfoh <elfadel@accuknox.com>
test-me-please |
Marking for backport since this will help users debug issues more easily. |
Fixes: #15864