Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Enhancement] ControllerClosure request-completion semantics lack direct tests

Đang mở Phù hợp với người mới
#11,337 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@chennaji9 đang làm issue này rồi.

Từ ngày 9/10/2026.

  • #11346 của @chennaji9 — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java

Hướng nghiên cứu

Bắt đầu bằng việc đọc ControllerClosure.java trong controller/src/main/java/org/apache/rocketmq/controller/impl/closure/ và ghi chú cách nó xây dựng phản hồi từ ControllerResult khi Status là OK, cách ánh xạ lỗi sang CONTROLLER_JRAFT_INTERNAL_ERROR, và cách lưu đệm Task lấy từ taskWithThisClosure(). Thêm một lớp kiểm thử mới trong cây thư mục test của module controller bao phủ ba hành vi đó, dùng DLedgerControllerTest làm chuẩn cho phần thiết lập. Hoàn thành khi các trường hợp OK, lỗi và lưu đệm Task đều vượt qua.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Java
Star
22.6k
Fork
12k
Merge trung bình
6 ngày 16 giờ
Pull request đã merge (30 ngày)
18

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/rocketmq

Tất cả issue của apache/rocketmq

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.