-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix][client]Fixed getting an incorrect maxMessageSize
value when accessing multiple clusters in the same process
#22306
[fix][client]Fixed getting an incorrect maxMessageSize
value when accessing multiple clusters in the same process
#22306
Conversation
…iple clusters in the same process.
@chenhongSZ Please add the following content to your PR description and select a checkbox:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, good work!
Please fix checkstyle error src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerTest.java:[96,8] (imports) UnusedImports: Unused import: org.apache.pulsar.client.impl.ClientCnx. |
fixed |
It might be necessary to fix this test: |
oh, I'll fix it later |
/pulsarbot run-failure-checks |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #22306 +/- ##
============================================
+ Coverage 73.57% 73.81% +0.23%
- Complexity 32624 32841 +217
============================================
Files 1877 1887 +10
Lines 139502 139479 -23
Branches 15299 15292 -7
============================================
+ Hits 102638 102955 +317
+ Misses 28908 28600 -308
+ Partials 7956 7924 -32
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/pulsarbot run-failure-checks |
…ccessing multiple clusters in the same process (#22306) Co-authored-by: atomchchen <[email protected]> (cherry picked from commit 71598c1)
…ccessing multiple clusters in the same process (#22306) Co-authored-by: atomchchen <[email protected]> (cherry picked from commit 71598c1)
…ccessing multiple clusters in the same process (apache#22306) Co-authored-by: atomchchen <[email protected]> (cherry picked from commit 71598c1) (cherry picked from commit bff6ea2)
…ccessing multiple clusters in the same process (apache#22306) Co-authored-by: atomchchen <[email protected]> (cherry picked from commit 71598c1) (cherry picked from commit bff6ea2)
…ccessing multiple clusters in the same process (apache#22306) Co-authored-by: atomchchen <[email protected]> (cherry picked from commit 71598c1) (cherry picked from commit bff6ea2)
…ccessing multiple clusters in the same process (apache#22306) Co-authored-by: atomchchen <[email protected]> (cherry picked from commit 71598c1) (cherry picked from commit bff6ea2)
…ccessing multiple clusters in the same process (apache#22306) Co-authored-by: atomchchen <[email protected]> (cherry picked from commit 71598c1) (cherry picked from commit bff6ea2)
…ccessing multiple clusters in the same process (apache#22306) Co-authored-by: atomchchen <[email protected]>
Motivation
We are using two PulsarClients within the same process to connect to cluster A (maxMessageSize=5M) and cluster B (maxMessageSize=16M), and sometimes the following error occurs.
Got corrupted payload message size 5251327 at org.apache.pulsar.common.api.proto.MessageIdData@5e940463
I think the root cause is that the client's
org.apache.pulsar.client.impl.ClientCnx#maxMessageSize
variable is static, which does not support different configurations of two clusters at the same time.Modifications
org.apache.pulsar.client.impl.ClientCnx#maxMessageSize
variable to be non-static, share this variable only within the same connection.Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: