Repository navigation
[ISSUE #11468] fix(proxy): keep every system property key on admin-sent messages - #11469
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
left a comment
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
RockteMQ-AI
left a comment
There was a problem hiding this comment.
LGTM. Clear bug fix — the break after the first key meant admin-sent messages silently lost all but the first index key, while the data plane kept the full list. The fix correctly collects every non-empty key and passes the list to setKeys, matching SendMessageActivity behavior. The test with [\"key1\", \"\", \"key2\", \"key3\"] → \"key1 key2 key3\" pins this behavior and fails on the unpatched code.
Automated review by github-manager-bot
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.