-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Fix regression to avoid freeing alive IPs #10207
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
test-me-please EDIT: All relevant tests passed |
aanm
reviewed
Feb 17, 2020
Introduce the ability to mark an IP to be expired after a certain time unless usage is confirmed in a later step. Protect IP reuse with active expiration timers with the help of an UUID. Updates: #10065 Signed-off-by: Thomas Graf <thomas@cilium.io>
Adds a helper function to allocate required addresses and start the expiration timer for all allocated IPs. Signed-off-by: Thomas Graf <thomas@cilium.io>
Signed-off-by: Thomas Graf <thomas@cilium.io>
This is a replacement fix for ab61853 which turned out to be racy, leading to alive PodIPs to be freed. Instead of attempting to reconstruct the context for potential release in CNI DEL for any failure scenarios, introduce an expiration timer that is enabled when any IP is allocated via the CNI plugin. The expiration timer must be explicitly stopped by the endpoint creation following the allocation to avoid releasing the IP again after a timeout. This ensures that IPs are always either used or released without requiring any cleanup from the CNI plugin itself. In the event that an IP is released due to expiration but then the endpoint still succeeds to be created, the endpoint creation will fail, triggering a re-creation of the endpoint. Fixes: #10065 Fixes: ab61853 ("cni: Release IP even when endpoint deletion fails") Signed-off-by: Thomas Graf <thomas@cilium.io>
bb8a074
to
442323c
Compare
test-me-please |
aanm
approved these changes
Feb 17, 2020
I'm trying to backport this one, but I think we need also #8016, since it depends on the |
Due to the complexity of backporting, I nominate dropping the 1.5 backport for this PR. Users that are affected by this issue can update to a recent v1.6.x or v1.7.x release to address this issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
kind/bug
This is a bug in the Cilium logic.
kind/regression
This functionality worked fine before, but was broken in a newer release 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.
This is a replacement fix for ab61853 which turned out to be racy, leading
to alive PodIPs to be freed. Instead of attempting to reconstruct the context
for potential release in CNI DEL for any failure scenarios, introduce an
expiration timer that is enabled when any IP is allocated via the CNI plugin.
The expiration timer must be explicitly stopped by the endpoint creation
following the allocation to avoid releasing the IP again after a timeout. This
ensures that IPs are always either used or released without requiring any
cleanup from the CNI plugin itself.
In the event that an IP is released due to expiration but then the endpoint
still succeeds to be created, the endpoint creation will fail, triggering a
re-creation of the endpoint.
Fixes: #10065
This change is