[ISSUE #10739] Complete proxy futures when processor executors reject tasks - #10740
[ISSUE #10739] Complete proxy futures when processor executors reject tasks#10740ai-yang wants to merge 1 commit into
Conversation
5780823 to
4d8997c
Compare
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Findings
-
[Info]
FutureUtils.java:27-34— The fix is correct.completionFuture.whenComplete(...)runs synchronously in the completing thread (not submitted to the executor), so it reliably catchesRejectedExecutionExceptionwithout needing another executor. Good design. -
[Info]
DefaultMessagingProcessor.java:89,98— Switching from the defaultDiscardOldestPolicytoAbortPolicyis the right call here. Under high load or shutdown, tasks that were previously silently discarded will now surface asRejectedExecutionException, whichFutureUtilscan properly propagate. This is a behavioral change, but it converts silent data loss into explicit failure — the correct tradeoff for a messaging system. -
[Info]
FutureUtilsTest.java— Test coverage is solid. The shut-down executor pattern reliably reproduces the rejection scenario, and assertingCompletionExceptionwrappingRejectedExecutionExceptionvalidates the full propagation chain. -
[Info]
DefaultMessagingProcessorTest.java— Good integration-level test that verifies the real executor chain propagates rejections through the future.
Suggestions
- Minor: Consider whether other thread pools in the Proxy module that also use
appendNextFuture(or similar future-chaining patterns) might need the sameAbortPolicytreatment. A quick audit ofThreadPoolMonitor.createAndMonitorcall sites in the proxy module could reveal similar latent issues.
Verdict
Well-structured bug fix that addresses both the symptom (pending futures) and root cause (silent task discarding). The two-level approach ensures robustness even if one layer is misconfigured.
Automated review by github-manager-bot
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
Defensive fix with proper validation and test coverage. LGTM.
Automated review by github-manager-bot
Signed-off-by: Rui <[email protected]>
4d8997c to
2d561e1
Compare
|
Refreshed onto current @lollipopjin @lizhimins, could you please take a human review when convenient, especially of the executor rejection-policy change and its overload semantics? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #10740 +/- ##
=============================================
- Coverage 48.58% 48.52% -0.07%
+ Complexity 13678 13655 -23
=============================================
Files 1381 1381
Lines 101475 101479 +4
Branches 13190 13190
=============================================
- Hits 49304 49244 -60
- Misses 46170 46217 +47
- Partials 6001 6018 +17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
This PR modifies 4 files (185 lines).
Key changes reviewed. Please see inline comments for specific suggestions.
Automated review by "github-manager-bot"
Which Issue(s) This PR Fixes
Brief Description
FutureUtils.appendNextFuturenow retains the stage returned bywhenCompleteAsyncand propagates completion-task scheduling failures to the future returned to the caller.The Proxy producer and consumer processor executors now use an explicit
AbortPolicy. This is required because the shared defaultDiscardOldestPolicycan silently discard completion tasks during shutdown or saturation, leaving no rejection forFutureUtilsto propagate. Other RocketMQ thread pools keep their existing rejection behavior.Together, these changes ensure that Proxy request futures reach an exceptional terminal state instead of remaining pending when processor completion work is rejected.
How Did You Test This Change?
DiscardOldestPolicymade the saturation regression fail 1/1 atthe returned future must not remain pending; restoringAbortPolicymade it pass.FutureUtilsTestpassed 1/1 andDefaultMessagingProcessorTestpassed 6/6. All 11 modules in the targetedproxy -amreactor succeeded with Checkstyle and SpotBugs enabled.proxy -amtest reactor also passed: Broker 752 tests (0 failures, 0 errors, 4 skipped) and Proxy 304 tests (0 failures, 0 errors, 3 skipped).git diff --checkpassed.