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

map: fix TestMapBatch failing with ENOSPC for hash maps #1485

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

lmb
Copy link
Collaborator

@lmb lmb commented Jun 10, 2024

The batch lookup API for hash maps returns ENOSPC when a bucket doesn't fit into the provided batch. This is unfortunate since user space has no way to figure out what the largest bucket size is. This makes the API very awkward to use.
It also seems that hash tables don't deal well with sequential keys, hashing them into the same bucket with fairly high probability.

Fix the flaky test by always making the batch size equal to the map size, which means we can never trigger ENOSPC. Also make the error message more descriptive.

Fixes: #1390

The batch lookup API for hash maps returns ENOSPC when a bucket doesn't
fit into the provided batch. This is unfortunate since user space has no
way to figure out what the largest bucket size is. This makes the API
very awkward to use.
It also seems that hash tables don't deal well with sequential keys,
hashing them into the same bucket with fairly high probability.

Fix the flaky test by always making the batch size equal to the map
size, which means we can never trigger ENOSPC. Also make the error
message more descriptive.

Fixes: cilium#1390
Signed-off-by: Lorenz Bauer <[email protected]>
@lmb lmb marked this pull request as ready for review June 11, 2024 07:53
@lmb lmb requested a review from a team as a code owner June 11, 2024 07:53
@lmb lmb merged commit 9d02bd3 into cilium:main Jun 11, 2024
17 checks passed
@lmb lmb deleted the batch-enospc branch June 11, 2024 07:53
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.

CI: TestMapBatch/Hash is flaky (arm64?)
1 participant