-
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 incoming message size issue that introduced in #9113 #9182
Fix incoming message size issue that introduced in #9113 #9182
Conversation
@BewareMyPower @lhotari Please help review this PR |
OK, I'll take a look soon. |
pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerTest.java
Outdated
Show resolved
Hide resolved
for (int i = 0; i < messages; i++) { | ||
messageIds.add(producer.newMessage().value(("Message-" + i).getBytes()).sendAsync()); | ||
} | ||
FutureUtil.waitForAll(messageIds).get(); |
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.
nitpick: in general, it's good to use timeouts in tests, for example using .get(3, TimeUnit.SECONDS)
. However, I guess it's not very likely that sending would fail at this point, so the timeout isn't that relevant in this case.
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.
I don't think using timeout is a good idea. We should rely on the test framework timeout not the timeouts within the test.
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.
@sijie yes, I agree that placing timeouts all over could clutter the test code.
Do you happen to know if there's already a default timeout set for each individual test method?
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.
Yes. The TestNG has global timeout settings.
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java
Outdated
Show resolved
Hide resolved
@BewareMyPower @315157973 I have addressed your comments, please take a look again. |
The import of VisibleForTesting has not been deleted, I don’t know if the style check will report an error |
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
Fix incoming message size issue that introduced in #9113. We should decrease the incoming message size when taking messages from the queue and increase the incoming message size while adding messages to the queue. With #9113, will always increase the incoming queue size. Add method `increaseIncomingSize` and `decreaseIncomingSize` Add a new test for verifying the incoming message size should be zero while the incoming queue size is zero. (cherry picked from commit 2cee0a8)
### Motivation Fix incoming message size issue that introduced in #9113. We should decrease the incoming message size when taking messages from the queue and increase the incoming message size while adding messages to the queue. With #9113, will always increase the incoming queue size. ### Modifications Add method `increaseIncomingSize` and `decreaseIncomingSize` ### Verifying this change Add a new test for verifying the incoming message size should be zero while the incoming queue size is zero. (cherry picked from commit 2cee0a8)
…e#9182) ### Motivation Fix incoming message size issue that introduced in apache#9113. We should decrease the incoming message size when taking messages from the queue and increase the incoming message size while adding messages to the queue. With apache#9113, will always increase the incoming queue size. ### Modifications Add method `increaseIncomingSize` and `decreaseIncomingSize` ### Verifying this change Add a new test for verifying the incoming message size should be zero while the incoming queue size is zero. (cherry picked from commit 2cee0a8)
…e#9182) ### Motivation Fix incoming message size issue that introduced in apache#9113. We should decrease the incoming message size when taking messages from the queue and increase the incoming message size while adding messages to the queue. With apache#9113, will always increase the incoming queue size. ### Modifications Add method `increaseIncomingSize` and `decreaseIncomingSize` ### Verifying this change Add a new test for verifying the incoming message size should be zero while the incoming queue size is zero.
Motivation
Fix incoming message size issue that introduced in #9113. We should decrease the incoming message size when taking messages from the queue and increase the incoming message size while adding messages to the queue. With #9113, will always increase the incoming queue size.
Modifications
Add method
increaseIncomingSize
anddecreaseIncomingSize
Verifying this change
Add a new test for verifying the incoming message size should be zero while the incoming queue size is zero.
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation