Don't try to subscribe to the topic if the consumer is closed.#7589
Merged
wolfstudy merged 3 commits intoJul 28, 2020
Conversation
jiazhai
approved these changes
Jul 18, 2020
Contributor
Author
|
/pulsarbot run-failure-checks |
Contributor
Author
|
/pulsarbot run-failure-checks |
1 similar comment
Contributor
Author
|
/pulsarbot run-failure-checks |
Contributor
Author
|
/pulsarbot run-failure-checks |
jiazhai
approved these changes
Jul 22, 2020
jiazhai
approved these changes
Jul 22, 2020
Contributor
Author
|
/pulsarbot run-failure-checks |
2 similar comments
Contributor
Author
|
/pulsarbot run-failure-checks |
Member
|
/pulsarbot run-failure-checks |
sijie
approved these changes
Jul 27, 2020
wolfstudy
pushed a commit
that referenced
this pull request
Jul 29, 2020
### Modifications Add state check when connection opened of the consumer. If the consumer state is closing or closed, we don’t need to send the subscribe command (cherry picked from commit 0b37b0c)
huangdx0726
pushed a commit
to huangdx0726/pulsar
that referenced
this pull request
Aug 24, 2020
…he#7589) ### Modifications Add state check when connection opened of the consumer. If the consumer state is closing or closed, we don’t need to send the subscribe command
lbenc135
pushed a commit
to lbenc135/pulsar
that referenced
this pull request
Sep 5, 2020
…he#7589) ### Modifications Add state check when connection opened of the consumer. If the consumer state is closing or closed, we don’t need to send the subscribe command
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.
Fixes #7559
Motivation
Fix race condition on the close consumer while reconnecting to the broker.
The race condition happens while the consumer reconnects to the broker, the cnx of the consumer set to null when reconnects to the broker.
pulsar/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConnectionHandler.java
Line 95 in 0c9c9fc
If close the consumer at this time, the client will not send close consumer command to the broker
pulsar/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
Line 743 in 208af7c
So, if the consumer reconnected to the broker, the consumer will send the subscribe command again.
Modifications
Add state check when connection opened of the consumer. If the consumer state is closing or closed, we don’t need to send the subscribe command
Does this pull request potentially affect one of the following parts:
If
yeswas chosen, please highlight the changesDocumentation