Fix stale RX subscription cache after subscriber registration - #1243
Draft
gmartin82 wants to merge 2 commits into
Draft
Fix stale RX subscription cache after subscriber registration#1243gmartin82 wants to merge 2 commits into
gmartin82 wants to merge 2 commits into
Conversation
gmartin82
force-pushed
the
fix/rx-cache-stale-subscription-lookup
branch
from
June 11, 2026 17:26
9716456 to
0e25de2
Compare
There was a problem hiding this comment.
Cppcheck (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
gmartin82
force-pushed
the
fix/rx-cache-stale-subscription-lookup
branch
from
June 12, 2026 10:26
4782dba to
9ece051
Compare
gmartin82
force-pushed
the
fix/rx-cache-stale-subscription-lookup
branch
from
June 12, 2026 10:34
9ece051 to
45f0f54
Compare
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.
Description
Fixes a stale RX-cache entry that could prevent newly registered subscribers from receiving matching samples.
What does this PR do?
z_rx_cache_testregression that warms an empty subscription lookup, registers a subscriber, then verifies the next matching sample is delivered.Z_FEATURE_RX_CACHEin the existing Linux ASAN integration job with advanced pub/sub features enabled.Why is this change needed?
With
Z_FEATURE_RX_CACHEenabled, a sample received before any matching subscriber exists can cache an empty lookup result. Registering a subscriber did not invalidate that cache, so later samples on the same key could still be treated as having no subscribers. This causedz_api_advanced_pubsub_testto fail in advanced pub/sub history scenarios.Related Issues
N/A
🏷️ Label-Based Checklist
Based on the labels applied to this PR, please complete these additional requirements:
Labels:
bug🐛 Bug Fix Requirements
Since this PR is labeled as a bug fix, please ensure:
Why this matters: Bugs without tests often reoccur.
Instructions:
- [ ]to- [x])This checklist updates automatically when labels change, but preserves your checked boxes.