-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Avoid infinite waiting for consumer close #11347
Conversation
@shoothzj thanks for your contribution. For this PR, do we need to update docs? (The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks) |
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
Outdated
Show resolved
Hide resolved
thanks for addressing my comments. did you see this problem in production or do you have a stacktrace with an NPE to show ? |
Yes, I noticed the problem in prodcution. The client calls |
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
I think we don't need any docs. |
@shoothzj OK. Can you leave doc-related info for future PRs? Thanks |
### Motivation If there are two Events - EventA: Server close the consumer - EventB: consumer close self If EventA and EventB concurrently, then the `cnx.ctx()` has probability to be null. Which occurs a NPE, lead to infinite wait future ### Modifications If the `cnx.ctx()` is already null, we ignore the exception too.
### Motivation If there are two Events - EventA: Server close the consumer - EventB: consumer close self If EventA and EventB concurrently, then the `cnx.ctx()` has probability to be null. Which occurs a NPE, lead to infinite wait future ### Modifications If the `cnx.ctx()` is already null, we ignore the exception too. (cherry picked from commit 4d3fdae)
### Motivation If there are two Events - EventA: Server close the consumer - EventB: consumer close self If EventA and EventB concurrently, then the `cnx.ctx()` has probability to be null. Which occurs a NPE, lead to infinite wait future ### Modifications If the `cnx.ctx()` is already null, we ignore the exception too.
Motivation
If there are two Events
If EventA and EventB concurrently, then the
cnx.ctx()
has probability to be null. Which occurs a NPE, lead to infinite wait futureModifications
If the
cnx.ctx()
is already null, we ignore the exception too.