You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "chennaji9 (via GitHub)" <gi...@apache.org> on 2026/10/09 12:55:18 UTC
[I] [Enhancement] ControllerClosure request-completion semantics lack direct tests [rocketmq]
chennaji9 opened a new issue, #11337:
URL: https://github.com/apache/rocketmq/issues/11337
### 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Enhancement] ControllerClosure request-completion semantics lack direct tests [rocketmq]
Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #11337:
URL: https://github.com/apache/rocketmq/issues/11337#issuecomment-6110388063
**Issue Evaluation**
Category: `type/enhancement` | Status: **Evaluated**
**Feasibility:** Feasible
**Scope:** `controller` module — `ControllerClosure` test coverage
**Compatibility:** No breaking changes
`ControllerClosure` is the decision point for every JRaft-driven controller request — it maps success/failure to response codes and completes futures. Direct tests for its request-completion semantics would catch regressions in error mapping and future completion paths.
**Assessment:** Valid enhancement. The closure's behavior on `Status#isOk` vs failure paths, and the `taskWithThisClosure()` caching, both lack direct test coverage.
---
*Automated evaluation by RocketMQ-AI*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Enhancement] ControllerClosure request-completion semantics lack direct tests [rocketmq]
Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #11337:
URL: https://github.com/apache/rocketmq/issues/11337#issuecomment-6095956180
**Issue Evaluation**
Category: `type/enhancement` | Status: **Evaluated**
**Feasibility:** Feasible
**Scope:** `controller` module — `ControllerClosure`
**Compatibility:** No breaking changes
Valid request. Direct tests for request-completion semantics (success/failure paths, JRaft error mapping) would protect the controller request lifecycle.
---
*Automated evaluation by RockteMQ-AI*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org