Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Enhancement] ControllerClosure request-completion semantics lack direct tests

オープン 初心者向け
#11,337 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@chennaji9 がすでに取り組んでいます。

2026年10月9日 から。

  • #11346 @chennaji9 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java

調査の方向性

まず controller/src/main/java/org/apache/rocketmq/controller/impl/closure/ にある ControllerClosure.java を読み、OK ステータスの場合に ControllerResult からレスポンスがどのように組み立てられるか、失敗が CONTROLLER_JRAFT_INTERNAL_ERROR にどのように対応づけられるか、taskWithThisClosure() から得た Task がどのようにキャッシュされるかをメモしてください。セットアップの慣習は DLedgerControllerTest を参考にして、この3つの振る舞いをカバーする新しいテストクラスを controller モジュールのテストツリーに追加してください。OK のケース、失敗のケース、Task キャッシングのケースがそれぞれ通れば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Java
スター
22.6k
フォーク
12k
平均マージ
4日 13時間
マージ済み PR(30日)
20

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/rocketmq のほかの issue

apache/rocketmq の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。