[INLONG-12073][Manager] Optimize Pulsar message query with thread pool and proper error handling#12074
Merged
healchow merged 8 commits intoapache:masterfrom Feb 25, 2026
Merged
Conversation
fuweng11
reviewed
Feb 24, 2026
...ava/org/apache/inlong/manager/service/resource/queue/pulsar/PulsarQueueResourceOperator.java
Outdated
Show resolved
Hide resolved
fuweng11
reviewed
Feb 24, 2026
...ava/org/apache/inlong/manager/service/resource/queue/pulsar/PulsarQueueResourceOperator.java
Outdated
Show resolved
Hide resolved
80bb259 to
57cd7f4
Compare
…l and proper error handling
98382c6 to
7322cde
Compare
fuweng11
previously approved these changes
Feb 25, 2026
luchunliang
previously approved these changes
Feb 25, 2026
vernedeng
previously approved these changes
Feb 25, 2026
2bc74b8
fuweng11
approved these changes
Feb 25, 2026
vernedeng
approved these changes
Feb 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[INLONG-12073][Manager] Optimize Pulsar message query with thread pool and proper error handling
Fixes #12073
Motivation
Currently, when querying MQ messages from multiple Pulsar clusters, there are several issues:
No thread pool management: Message queries are executed without proper thread pool management, which may lead to resource exhaustion under high concurrency.
No graceful handling for task rejection: When too many concurrent requests come in, the system doesn't properly handle the
RejectedExecutionExceptionand doesn't provide a user-friendly error response.No task cancellation mechanism: When task submission fails, previously submitted tasks continue to run unnecessarily.
No interruption support: Long-running IO operations cannot be cancelled when the request is aborted.
Modifications
Add a dedicated thread pool: Use
ThreadPoolTaskExecutorwith configurable core/max pool size and queue capacity for message query tasks.Implement task cancellation: When
RejectedExecutionExceptionoccurs, cancel all previously submitted tasks to free up resources.Add interruption checks: Check
Thread.currentThread().isInterrupted()before and after IO operations to support task cancellation.Verifying this change
This change is a trivial rework/code cleanup without any test coverage.
This change is already covered by existing tests, such as:
(please describe tests)
This change added tests and can be verified as follows:
Documentation