envoy: Handle pending completions for deleted policies#44754
Merged
jrajahalme merged 4 commits intocilium:mainfrom Mar 13, 2026
Merged
Conversation
Metrics mock had nack and ack reversed, fix it. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
Add a unit test for case where a completion is created for resource upsert, but the resource is Deleted before the ACK is processed. This is currently failing, fix is in the following commit. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
3 tasks
When a network policy is deleted, the resource names of them need to be deleted from any pending completions to allow the Wait on the WaitGroup to return when the ACK is received from Envoy. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
f7cf5f3 to
93306f3
Compare
Member
Author
|
Fixed a Go lint finding. |
Member
Author
|
/test |
fristonio
approved these changes
Mar 12, 2026
nezdolik
approved these changes
Mar 13, 2026
sayboras
approved these changes
Mar 13, 2026
|
Hey @jrajahalme thanks for working on this! Is this change going to be backported to 1.18.x ? 🙏🏽 |
christarazi
reviewed
Mar 14, 2026
| } | ||
| if pending.typeURL == typeURL { | ||
| for _, resourceNames := range pending.remainingNodesResources { | ||
| // resourceNames map is left in place even if empty, so that |
Member
There was a problem hiding this comment.
Nit: This comment is useful here, but it might also be worth adding a corresponding note on the other end, inside HandleResourceVersionAck where len(remainingResourceNames) == 0 is checked. That's where the empty map is actually consumed, and a future reader seeing it might not realize it was intentionally emptied by Delete. A short comment there pointing back here would close this loop IMO.
This was referenced Mar 16, 2026
1 task
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
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.
When a network policy is deleted, the resource names of them need to be deleted from any pending completions to allow the Wait on the WaitGroup to return when the ACK is received from Envoy.
Fixes: #44543
Fixes: #44714