[Enhancement] ControllerClosure request-completion semantics lack direct tests
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- java
- Domain
- distributed-systems, testing
Research direction
Start by reading ControllerClosure.java in controller/src/main/java/org/apache/rocketmq/controller/impl/closure/ and note how it builds the response from ControllerResult on an OK Status, maps failures to CONTROLLER_JRAFT_INTERNAL_ERROR, and caches the Task from taskWithThisClosure(). Add a new test class in the controller module's test tree that covers those three behaviours, using DLedgerControllerTest for setup conventions. Done when the OK, failure and task-caching cases each pass.
Written by the indexing model from the issue text.
Description
Description
ControllerClosure (controller/src/main/java/org/apache/rocketmq/controller/impl/closure/ControllerClosure.java) decides how every JRaft-driven controller request completes:
- on
Status#isOk, it builds the response from theControllerResult(code, optional body, optional remark) and completes the future; - on failure, it maps any JRaft error to
ResponseCode.CONTROLLER_JRAFT_INTERNAL_ERRORwith the status message; taskWithThisClosure()caches a JRaftTaskwhosedoneis the closure and whose data is the encoded request.
None of this has direct test coverage — a search of the module shows no test touches ControllerClosure. A regression in the response mapping (dropped body/remark, wrong error code, un-cached task re-encoding, wrong closure binding) would not be caught by the existing DLedgerControllerTest / manager tests, which don't exercise request completion.
Expected behavior
Direct contract tests: OK status completes the future with the configured code/body/remark (and leaves body/remark unset when absent); a failed status completes with CONTROLLER_JRAFT_INTERNAL_ERROR and the JRaft error message; taskWithThisClosure() returns the same Task instance on repeat calls, bound to this closure, carrying the encoded request.
- Dominant language
- Java
- Stars
- 22.6k
- Forks
- 12k
- Avg merge
- 6d 16h
- Merged PRs (30d)
- 18
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/rocketmq
-
[Bug] mqadmin createUser/updateUser trim the ACL password, storing a secret the caller never typedPossibly taken @iloveeyjafjalla claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/rocketmq#11446 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug] notifyMasterOnline aborts the long-polling wake-up with a NullPointerException when an arrival drains a bucket firstPossibly taken @iloveeyjafjalla claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
apache/rocketmq#11441 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug] DefaultMQPushConsumer.shutdown() never stops the pop consume service, so its non-daemon threads keep the JVM alivePossibly taken @iloveeyjafjalla claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
apache/rocketmq#11427 · 2 comments ·
Maintainers usually reply within 1 day
-
[Enhancement] FilterFactory duplicate-registration and unregister semantics lack testsPossibly taken @chennaji9 claimed this 7 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/rocketmq#11340 · 2 comments ·
Maintainers usually reply within 1 day
-
[Enhancement] LogicExpression three-valued truth table and short-circuit behavior lack direct testsPossibly taken @chennaji9 claimed this 7 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/rocketmq#11339 · 2 comments ·
Maintainers usually reply within 1 day
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
scylladb/scylla-cdc-source-connector#350 ·
Maintainers usually reply within 1 day
-
agent:working documentation enhancement go:build lane:needs-decision
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Sanne/incus-spawn#1435 · 3 comments ·
Maintainers usually reply within 1 day
-
area:shuffle bug priority:high requires-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
apache/datafusion-comet#7062 ·
Maintainers usually reply within 1 day
-
wait for review
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
enhancement good first issue up-for-grabs
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
AnikethTS/ChangeRadar#22 ·
Maintainers usually reply within 1 day