Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Enhancement] ControllerClosure request-completion semantics lack direct tests

Open Beginner friendly
#11,337 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@chennaji9 is already working on this.

Since Oct 9, 2026.

  • #11346 by @chennaji9 — open

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

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 the ControllerResult (code, optional body, optional remark) and completes the future;
  • on failure, it maps any JRaft error to ResponseCode.CONTROLLER_JRAFT_INTERNAL_ERROR with the status message;
  • taskWithThisClosure() caches a JRaft Task whose done is 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/rocketmq

All issues in apache/rocketmq

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.