[Bug] DefaultReceiptHandleManager leaves its renew and return-handle thread pools running after shutdown
Maintainer thường phản hồi trong vòng 1 ngày
@iloveeyjafjalla đang làm issue này rồi.
Từ ngày 13/10/2026.
Đá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
- 22/100
Hướng nghiên cứu
Start in DefaultReceiptHandleManager: read its constructor, where renewalWorkerService and returnHandleGroupWorkerService are created, and its shutdown() method, which currently only stops scheduledExecutorService and calls clearAllHandle(). Confirm that nothing shuts the two pools down. Done means both pools are shut down after clearAllHandle() returns, so remaining handles still reach a running pool. Two open pull requests (#11394, #11421) already target this, so check them before starting.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Before Creating the Bug Report
- I found a bug, not just asking a question, which should be created in GitHub Discussions.
- I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.
- I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.
Runtime platform environment
OS: any (proxy module, receipt handle renewal)
RocketMQ version
branch: develop
Git commit id: a7edeecfb (2026-10-13; the file is unchanged by that commit)
JDK Version
Compiler: Temurin 1.8.0_504 (target 1.8, same as CI)
Describe the Bug
DefaultReceiptHandleManager never shuts down the two worker pools it creates.
The constructor creates both pools for itself:
this.renewalWorkerService = ThreadPoolMonitor.createAndMonitor(
proxyConfig.getRenewThreadPoolNums(), proxyConfig.getRenewMaxThreadPoolNums(), 1, TimeUnit.MINUTES,
"RenewalWorkerThread", proxyConfig.getRenewThreadPoolQueueCapacity());
this.returnHandleGroupWorkerService = ThreadPoolMonitor.createAndMonitor(
proxyConfig.getReturnHandleGroupThreadPoolNums(), proxyConfig.getReturnHandleGroupThreadPoolNums() * 2,
1, TimeUnit.MINUTES, "ReturnHandleGroupWorkerThread", proxyConfig.getRenewThreadPoolQueueCapacity());
but the shutdown registered with the manager's lifecycle only stops the scheduler and clears the handles:
public void shutdown() throws Exception {
scheduledExecutorService.shutdown();
clearAllHandle();
}
renewalWorkerService.shutdown() / returnHandleGroupWorkerService.shutdown() appear nowhere in the repository (only
creation and use), and the threads are not daemons (ThreadFactoryBuilder().setNameFormat(...), no setDaemon(true)), so
after the manager is shut down — e.g. an in-JVM proxy stop/restart (embedded use, integration tests, or a restart within one
process) — up to renewThreadPoolNums + returnHandleGroupThreadPoolNums (defaults 2 + 2, max doubled) threads plus their
queued renew/return tasks keep running against services that are being torn down.
Steps to Reproduce
- Run the proxy so at least one handle renewal is scheduled (
enableProxyAutoRenew=trueis the default). - Stop the proxy in the same JVM (the manager's
shutdown()runs through the proxy lifecycle). renewalWorkerService.isShutdown()andreturnHandleGroupWorkerService.isShutdown()are bothfalse; the
RenewalWorkerThread-*/ReturnHandleGroupWorkerThread-*threads are still alive.
Expected behavior
shutdown() releases the pools it created, after the remaining handles have been handed back
(clearAllHandle() submits them to returnHandleGroupWorkerService).
Actual behavior
The two pools keep running past the shutdown.
Additional context
Fix: shut both pools down at the end of the manager's shutdown, after clearAllHandle() so the remaining handles are still
submitted to a running pool.
- Ngôn ngữ chính
- Java
- Star
- 22.7k
- Fork
- 12k
- Merge trung bình
- 3 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 17
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/rocketmq
-
[Bug] RemotingHelper.connect swaps the socket send and receive buffer configurationCó thể đã có người làm @amalsaidov đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
CompressionType.of fails under the Turkish localeCó thể đã có người làm @sharanggupta đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[rocketmq-client-python] TransactionMQProducer allocates an unused producer during initializationĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] notifyMasterOnline aborts the long-polling wake-up with a NullPointerException when an arrival drains a bucket firstCó thể đã có người làm @iloveeyjafjalla đã nhận 29 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
apache/rocketmq#11441 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Enhancement] FilterFactory duplicate-registration and unregister semantics lack testsCó thể đã có người làm @chennaji9 đã nhận 34 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
apache/rocketmq#11340 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của apache/rocketmq
Issue tương tự
-
bug emitter:client:csharp
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
microsoft/typespec#12572 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
GCC 15.2: -Wcast-qual warning - cast discards const qualifier from pointer target type (H5trace.c)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-area-label
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
area/ai area/backend component/zeebe kind/task
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
spAnser/reacharound#38 ·