[ISSUE #10737] Propagate admin future failures - #10738
Open
ai-yang wants to merge 1 commit into
Open
Conversation
Signed-off-by: Rui <1685901819@qq.com>
ai-yang
marked this pull request as ready for review
August 1, 2026 04:11
RockteMQ-AI
approved these changes
Aug 1, 2026
RockteMQ-AI
left a comment
Contributor
There was a problem hiding this comment.
Review by github-manager-bot
Summary
Fixes CompletableFuture propagation in all 19 async admin operations of MqClientAdminImpl. The previous thenAccept pattern left the caller's future permanently pending when the remoting call failed or the response handler threw.
Findings
- [Info]
MqClientAdminImpl.java:406-420— The newhandleResponsehelper correctly useswhenCompleteto bridge both remoting failures and handler exceptions to the public future. CatchingThrowablein the handler path is appropriate since decoder/handler code may throw unchecked exceptions. - [Info]
MqClientAdminImpl.java— All 19 call sites are updated consistently with the same pattern. No call site was missed. - [Info]
MqClientAdminImplTest.java:529-596— TheallOperationsShouldPropagateRemotingFailuretest efficiently covers all 19 operations in a single test by collecting futures and asserting after a singlecompleteExceptionally. TheoperationShouldPropagateResponseHandlerFailuretest covers the decoder-failure path with a null body triggering NPE.
Suggestions
No issues found. The fix is minimal, correct, and well-tested.
- Correctness: The root cause (pending futures on error) is properly addressed.
whenCompleteis the right choice overhandleorexceptionallysince it preserves the void-like bridge pattern. - Compatibility: No public API or protocol change. The
handleResponsemethod is private. - Tests: 41/41 tests pass, including the two new regression tests.
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.
Which Issue(s) This PR Fixes
Brief Description
MqClientAdminImplusedthenAcceptto complete a separate result future and ignored the dependent stage. An exceptional remoting completion skipped the handler, while a decoder/handler exception completed only that ignored stage; in both cases the future returned to the caller remained pending.Add one generic response bridge and use it for all 19 asynchronous admin operations. The bridge propagates the upstream remoting throwable and completes the public future exceptionally if existing response handling throws. Normal SUCCESS and non-SUCCESS response-code behavior is unchanged, and there is no public API or protocol change.
How Did You Test This Change?
MqClientAdminImplTest: 41/41 passed.validate/ Checkstyle: 0 violations across common, remoting, and client.BugInstance=0,Error=0across common, remoting, and client.git diff --check: passed.