Fixed accessing MessageImpl after it was enqueued on user queue#11824
Merged
Conversation
merlimat
requested review from
codelipenghui,
hangc0276,
jerrypeng and
rdhabalia
August 27, 2021 23:42
codelipenghui
approved these changes
Aug 28, 2021
Contributor
|
@MMirelli this may be a problem that should make some Fallout tests against current master to fail. |
eolivelli
approved these changes
Aug 28, 2021
eolivelli
left a comment
Contributor
There was a problem hiding this comment.
Lgtm
It would be good to have a test case that covers this problem
hangc0276
pushed a commit
that referenced
this pull request
Aug 29, 2021
(cherry picked from commit 666ad3b)
This was referenced Sep 18, 2021
bharanic-dev
pushed a commit
to bharanic-dev/pulsar
that referenced
this pull request
Mar 18, 2022
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.
Motivation
There is an exception that is thrown (and not shown, but that's a different issue) when using a consumer with message pooling enabled and consuming from a partitioned topic.
After a short amount of time the consumption silently stops.
The exception is:
The issue is easily reproducible by using
pulsar-perf consumeover a partitioned topic, sincepulsar-perfis using message pooling by default.The root cause is that we are accessing the message object instance after it was enqueued on the queue where the user will pick it up.
The user is doing something like:
When
msg.release()gets called, the object fields are nulled and then the object goes back to the pool. For that, from inside the client lib, we cannot touch that object from the moment it gets put on the queue.