Skip to content
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

Merged
merged 2 commits into from
Jan 13, 2021

Conversation

codelipenghui
Copy link
Contributor

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.

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

  • Does this pull request introduce a new feature? (no)

@codelipenghui
Copy link
Contributor Author

@BewareMyPower @lhotari Please help review this PR

@BewareMyPower
Copy link
Contributor

OK, I'll take a look soon.

for (int i = 0; i < messages; i++) {
messageIds.add(producer.newMessage().value(("Message-" + i).getBytes()).sendAsync());
}
FutureUtil.waitForAll(messageIds).get();
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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?

Copy link
Member

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.

@codelipenghui
Copy link
Contributor Author

@BewareMyPower @315157973 I have addressed your comments, please take a look again.

@315157973
Copy link
Contributor

The import of VisibleForTesting has not been deleted, I don’t know if the style check will report an error

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codelipenghui codelipenghui merged commit 2cee0a8 into apache:master Jan 13, 2021
@codelipenghui codelipenghui deleted the penghui/fix-incoming-size branch January 13, 2021 02:06
codelipenghui added a commit that referenced this pull request Jan 13, 2021
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)
@codelipenghui codelipenghui added the cherry-picked/branch-2.7 Archived: 2.7 is end of life label Jan 14, 2021
codelipenghui added a commit that referenced this pull request Jan 14, 2021
### 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)
freeznet pushed a commit to streamnative/pulsar-archived that referenced this pull request Jan 14, 2021
…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)
merlimat pushed a commit to merlimat/pulsar that referenced this pull request Apr 6, 2021
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants