-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
proxy: Do not panic on local error #25969
Merged
dylandreimerink
merged 3 commits into
cilium:main
from
jrajahalme:proxy-panic-fix-on-missing-listener
Jun 7, 2023
Merged
proxy: Do not panic on local error #25969
dylandreimerink
merged 3 commits into
cilium:main
from
jrajahalme:proxy-panic-fix-on-missing-listener
Jun 7, 2023
Conversation
This file contains 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
CreateOrUpdateRedirect called nil revertFunc when any local error was returned. This was done using the pattern `return 0, err, nil, nil` which sets the revertFunc return variable as nil, but this was called on a deferred function to revert any changes on a local error. Fix this by calling ReverStack.Revert() directly on the deferred function, and setting the return variable if there was no local error. This was hit any time a CiliumNetworkPolicy referred to a non-existing listener. Add a test case that reproduced the panic and works after the fix. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
jrajahalme
added
kind/bug
This is a bug in the Cilium logic.
release-note/bug
This PR fixes an issue in a previous release of Cilium.
release-blocker/1.13
This issue will prevent the release of the next version of Cilium.
needs-backport/1.13
This PR / issue needs backporting to the v1.13 branch
release-blocker/1.14
This issue will prevent the release of the next version of Cilium.
labels
Jun 7, 2023
Only update an existing redirect if it is configured. This prevents Cilium agent panic when trying to update redirect with released proxy port. This has only been observed to happen with explicit Envoy listener redirects in CiliumNetworkPolicy when the listener has been removed. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
Increment non-DNS proxy ports on failure even if DNS has been configured with a static port. Fixes: cilium#20896 Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
/test |
sayboras
approved these changes
Jun 7, 2023
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.
LGTM ✔️
maintainer-s-little-helper
bot
added
the
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
label
Jun 7, 2023
pchaigno
added
backport-pending/1.13
The backport for Cilium 1.13.x for this PR is in progress.
and removed
release-blocker/1.13
This issue will prevent the release of the next version of Cilium.
labels
Jun 9, 2023
michi-covalent
added
backport-done/1.13
The backport for Cilium 1.13.x for this PR is done.
and removed
backport-pending/1.13
The backport for Cilium 1.13.x for this PR is in progress.
labels
Jun 9, 2023
michi-covalent
moved this from Backport pending to v1.13
to Backport done to v1.13
in 1.13.4
Jun 9, 2023
This was referenced Jun 13, 2023
jrajahalme
removed
the
needs-backport/1.13
This PR / issue needs backporting to the v1.13 branch
label
Jun 21, 2023
Added |
7 tasks
maintainer-s-little-helper
bot
moved this from Needs backport from main
to Backport pending to v1.11
in 1.11.18
Jun 22, 2023
10 tasks
tklauser
added
backport-done/1.11
The backport for Cilium 1.11.x for this PR is done.
and removed
backport-pending/1.11
labels
Jun 29, 2023
maintainer-s-little-helper
bot
moved this from Backport pending to v1.11
to Backport done to v1.11
in 1.11.18
Jun 29, 2023
tklauser
added
backport-done/1.12
The backport for Cilium 1.12.x for this PR is done.
and removed
backport-pending/1.12
labels
Jun 29, 2023
This was referenced Jul 26, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport-done/1.11
The backport for Cilium 1.11.x for this PR is done.
backport-done/1.12
The backport for Cilium 1.12.x for this PR is done.
backport-done/1.13
The backport for Cilium 1.13.x for this PR is done.
kind/bug
This is a bug in the Cilium logic.
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
release-blocker/1.14
This issue will prevent the release of the next version of Cilium.
release-note/bug
This PR fixes an issue in a previous release of Cilium.
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.
CreateOrUpdateRedirect called nil revertFunc when any local error was returned. This was done using the pattern
return 0, err, nil, nil
which sets the revertFunc return variable as nil, but this was called on a deferred function to revert any changes on a local error.Fix this by calling ReverStack.Revert() directly on the deferred function, and setting the return variable if there was no local error.
Another panic was possible when updating an existing redirect the proxy port of which had been released. Check that the proxy port is initialized before reusing the (possibly stale) redirect.
This was hit any time a CiliumNetworkPolicy referred to a non-existing listener.
Add a test case that reproduced the panic and works after the fix.
Increment proxy port on failure for non-DNS ports, even if DNS has been configured with a static port.