Skip to content
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

[1.11] Fix for service backend entry leak #495

Merged
merged 2 commits into from
Feb 21, 2023

Conversation

hemanthmalla
Copy link
Member

@hemanthmalla hemanthmalla commented Feb 21, 2023

Cherry picks from cilium#23749 and cilium#23858
Check commit messages for details.

hemanthmalla and others added 2 commits February 21, 2023 16:33
Backends are meant to be reused across services. When service backends
are updated, existence of every backend is looked up by it's hash.
Currently, the check is made only against the current service's backends
but not against global backends.

This can result in duplicate backend entries. Without this commit whether
duplicate is created or not depends on a race between releasing old
backend ID during deletion and updating ref. count during creation.
Currently on agent startup when service restoration process finds a
duplicate entry, restoration stops and the rest of the entries are leaked.
Over time with enough restarts, we could max out the backend bpf map.

This commit makes the lookup global and entries in backendByHash map are
deleted only after data from lbmap is deleted. This should prevent
duplicate entries in backend map.

Fixes cilium#23551

Signed-off-by: Hemanth Malla <hemanth.malla@datadoghq.com>
Reported-by: Hemanth Malla <hemanth.malla@datadoghq.com>
Signed-off-by: Aditi Ghag <aditi@cilium.io>
@hemanthmalla hemanthmalla merged commit a084a50 into v1.11-dd-debug Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants