Skip to content

cilium: Separate NPHDS subscription and host map stats - #2007

Merged
jrajahalme merged 1 commit into
mainfrom
nphds-stats-prefix-fix
Aug 21, 2026
Merged

cilium: Separate NPHDS subscription and host map stats#2007
jrajahalme merged 1 commit into
mainfrom
nphds-stats-prefix-fix

Conversation

@jrajahalme

@jrajahalme jrajahalme commented Aug 20, 2026

Copy link
Copy Markdown
Member

Use the cilium.nphds scope for the generic gRPC subscription stats while retaining cilium.hostmap for stats tracking successfully applied host map updates.

Previously both sets of stats shared the cilium.hostmap scope, causing update_success to be incremented twice for each accepted NPHDS response. Tests waiting on this counter could consequently proceed before the corresponding host map update had been installed, resulting in a timing-dependent assertion failure under ASAN.

This follows the existing policy map convention, where NPDS subscription stats and successfully applied policy update stats use separate scopes.

Since NPHDS is not used in production this only showed up as CI test flakes like this:

#18 221.5 tests/bpf_metadata_integration_test.cc:648: Failure
#18 221.5 Expected equality of these values:
#18 221.5   resolveHostPolicyId("10.1.1.1")
#18 221.5     Which is: 111
#18 221.5   Cilium::ID::UNKNOWN
#18 221.5     Which is: 0

@jrajahalme
jrajahalme requested a review from a team as a code owner August 20, 2026 13:02
@jrajahalme
jrajahalme requested a review from nezdolik August 20, 2026 13:02
@jrajahalme jrajahalme added the bug Something isn't working label Aug 20, 2026

@nezdolik nezdolik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like ci needs fixing

Use the cilium.nphds scope for the generic gRPC subscription stats while
retaining cilium.hostmap for stats tracking successfully applied host map
updates.

Previously both sets of stats shared the cilium.hostmap scope, causing
update_success to be incremented twice for each accepted NPHDS response.
Tests waiting on this counter could consequently proceed before the
corresponding host map update had been installed, resulting in a
timing-dependent assertion failure under ASAN.

This follows the existing policy map convention, where NPDS subscription
stats and successfully applied policy update stats use separate scopes.

Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
@jrajahalme
jrajahalme force-pushed the nphds-stats-prefix-fix branch from a685bd7 to 731a687 Compare August 21, 2026 13:11
@jrajahalme
jrajahalme merged commit 8c212c2 into main Aug 21, 2026
9 of 10 checks passed
@jrajahalme
jrajahalme deleted the nphds-stats-prefix-fix branch August 21, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants