-
Notifications
You must be signed in to change notification settings - Fork 3.4k
proxy: Ensure proxy ports are written on shutdown #35839
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
jrajahalme
merged 2 commits into
cilium:main
from
jrajahalme:proxy-ports-persistence-fixes
Nov 12, 2024
Merged
proxy: Ensure proxy ports are written on shutdown #35839
jrajahalme
merged 2 commits into
cilium:main
from
jrajahalme:proxy-ports-persistence-fixes
Nov 12, 2024
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
sayboras
approved these changes
Nov 7, 2024
/test |
9fc3b55
to
985cecf
Compare
/test |
sayboras
approved these changes
Nov 8, 2024
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
Move proxy port restoration to the cell just before the trigger for writing the proxy ports file is created. This removes the possibility that the trigger would run before the ports are restored. Add a configurable time limit ('--restored-proxy-ports-age-limit', default 15 minutes) for the age of the restored proxy ports file to remove the chance that stale port numbers would be used e.g., on upgrade after a downgrade to Cilium 1.15 (which does not store the proxy ports to a file). Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
This commit wraps the proxy ports checkpoint function in a controller. This has two effects: 1. If the checkpoint fails due to I/O errors, the checkpoint is retried until it succeeds. Previously, we relied on it being triggered again for it to be re-ran (though so far we have not observed any I/O failures in CI, so this likely was not an issue) 2. By using a controller `StopFunc` and calling `RemoveControllerAndWait` we ensure the checkpoint function is ran one last time during shutdown. This is important, since `Trigger.Shutdown` by itself does not run any pending triggers. Note that any errors during shutdown are only logged and the controller is not re-tried. The proxy ports trigger is closed when the proxy cell is stopped, which happens e.g. when SIGTERM is received. Signed-off-by: Sebastian Wicki <sebastian@isovalent.com> Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
985cecf
to
c0a1d0d
Compare
Updated docs |
/test |
closing & reopening to kick CI again |
/test |
ldelossa
approved these changes
Nov 11, 2024
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
13 tasks
This was referenced Nov 12, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
affects/v1.14
This issue affects v1.14 branch
affects/v1.15
This issue affects v1.15 branch
area/proxy
Impacts proxy components, including DNS, Kafka, Envoy and/or XDS servers.
backport-done/1.14
The backport for Cilium 1.14.x for this PR is done.
backport-done/1.15
The backport for Cilium 1.15.x for this PR is done.
backport-done/1.16
The backport for Cilium 1.16.x for this PR is done.
kind/bug
This is a bug in the Cilium logic.
release-note/misc
This PR makes changes that have no direct user impact.
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.
Use a controller to make sure the proxy port file is written on shutdown.
Move proxy port restoration to the cell just before the trigger for writing the proxy ports file is created. This removes the possibility that the trigger would run before the ports are restored.
Add a configurable time limit ('
--restored-proxy-ports-age-limit
', default15
minutes) for the age of the restored proxy ports file to remove the chance that stale port numbers would be used e.g., on upgrade after a downgrade to Cilium 1.15 (which does not store the proxy ports to a file).