Repository navigation
[ISSUE #11468] fix(proxy): keep every system property key on admin-sent messages - #11469
Open
Felix-Gong wants to merge 1 commit into
Open
Felix-Gong wants to merge 1 commit into
Felix-Gong wants to merge 1 commit into
Conversation
…min-sent messages buildAdminMessage read request.system_properties.keys but kept only the first non-empty entry (setKeys + break). The data plane preserves the whole repeated field (SendMessageActivity joins the list via Message.setKeys(Collection)), so an AdminSendMessage carrying several index keys silently lost all but the first while still answering OK. Collect every non-empty key and hand the full list to setKeys, matching the data plane. Precedence with the singular key field is unchanged: a non-empty system_properties.keys still overrides it, and an all-empty list leaves the singular key in place. The new adminSendMessageKeepsAllSystemPropertyKeysTest fails with key1 vs 'key1 key2 key3' on the unpatched service (verified red/green). Full proxy module: 454 tests green on JDK 11.
RockteMQ-AI
approved these changes
Oct 20, 2026
RockteMQ-AI
left a comment
Contributor
There was a problem hiding this comment.
Review by github-manager-bot
Summary
Fixes buildAdminMessage in ProxyAdminGrpcService to retain all non-empty keys from system_properties.keys instead of only the first one, aligning the admin path with the data plane behavior.
Findings
- [Info]
ProxyAdminGrpcService.java:1413-1421— Clean fix. The originalbreakafter the first non-empty key was clearly a bug; collecting into aList<String>and passing tosetKeys(List)correctly mirrorsSendMessageActivity/Message.setKeys(Collection). - [Info]
ProxyAdminGrpcService.java:1416— Theif (!keys.isEmpty())guard correctly preserves the precedence contract: when all entries insystem_properties.keysare empty, the singularkeyfield remains untouched. Good defensive coding. - [Info]
ProxyAdminGrpcServiceTest.java:1281-1311— TestadminSendMessageKeepsAllSystemPropertyKeysTestis well-structured: it sends["key1", "", "key2", "key3"]and asserts the stored message carrieskey1 key2 key3. The empty-string filtering is covered. The bidirectional verification (fails on unpatched code, passes on patched) adds confidence.
Suggestions
- Minor: consider adding a test case where all entries in
system_properties.keysare empty strings, to verify the singularkeyfallback is preserved. This would lock in the precedence contract explicitly.
Overall this is a clean, minimal, well-tested bug fix. LGTM. 👍
Automated review by github-manager-bot
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.
Fixes #11468
buildAdminMessagekept only the first non-empty entry of the repeatedsystem_properties.keysfield (setKeys+break), so anAdminSendMessagecarrying several index keys stored just one of them and still answered OK. The data plane keeps the whole list —SendMessageActivityhandssystem_properties.keystoMessage.setKeys(Collection), which joins it.The change collects every non-empty key and passes the list to
setKeys, matching the data plane. Precedence with the singularkeyfield is untouched: a non-emptysystem_properties.keysstill overrides it, and an all-empty list leaves the singular key in place.Test:
adminSendMessageKeepsAllSystemPropertyKeysTestsends["key1", "", "key2", "key3"]and asserts the stored message carrieskey1 key2 key3. It fails withkey1vskey1 key2 key3on the unpatched service (checked both ways). Fullproxymodule: 454 tests green on JDK 11.Coordination: PR #11357 touches
selectQueuein the same class for #11356; this change is confined tobuildAdminMessageand its key handling, so the two do not overlap.