[fix][client] Producer uses pulsar-client-internal thread to execute callback#21913
Closed
nodece wants to merge 1 commit intoapache:masterfrom
Closed
[fix][client] Producer uses pulsar-client-internal thread to execute callback#21913nodece wants to merge 1 commit intoapache:masterfrom
nodece wants to merge 1 commit intoapache:masterfrom
Conversation
…callback Signed-off-by: Zixuan Liu <nodeces@gmail.com>
Member
Author
|
Some tests fail when multiple threads are used to execute callbacks. |
Member
Author
|
/pulsarbot rerun-failure-checks |
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.
Fixes #21900
Motivation
In #21900, I guess the user uses a sync call in the
pulsar-client-iocallback thread, so throw the timeout exception.The
pulsar-client-iothread is used to communicate between the broker and the client, whenpulsar-client-iois stuck, the timeout exception will be thrown.If we switch from the
pulsar-client-ioto thepulsar-client-internalthread to execute the callback, #21900 will be fixed.In the consumer, there's a similar approach:
pulsar/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
Lines 471 to 487 in 252509e
Another approach: Please use the same call(sync or async) in your project.
Modifications
pulsar-client-internalthread to execute the callback.Verifying this change
ProducerCallbackThreadTesthas been added.Documentation
docdoc-requireddoc-not-neededdoc-complete