You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/07/18 02:21:29 UTC

[GitHub] [pulsar] codelipenghui opened a new pull request #7589: Fix race condition on the close consumer while reconnecting to the broker.

codelipenghui opened a new pull request #7589:
URL: https://github.com/apache/pulsar/pull/7589


   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.
   
   https://github.com/apache/pulsar/blob/0c9c9fccbbdebd730acc04a759786babe4ce967a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConnectionHandler.java#L95
   
   If close the consumer at this time, the client will not send close consumer command to the broker
   
   https://github.com/apache/pulsar/blob/208af7cd7e718d378707df4aba600be3202e23df/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java#L743
   
   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 `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)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui commented on pull request #7589: Fix race condition on the close consumer while reconnecting to the broker.

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on pull request #7589:
URL: https://github.com/apache/pulsar/pull/7589#issuecomment-661895560


   /pulsarbot run-failure-checks


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui commented on pull request #7589: Don't try to subscribe to the topic if the consumer is closed.

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on pull request #7589:
URL: https://github.com/apache/pulsar/pull/7589#issuecomment-663776948


   /pulsarbot run-failure-checks


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui commented on pull request #7589: Don't try to subscribe to the topic if the consumer is closed.

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on pull request #7589:
URL: https://github.com/apache/pulsar/pull/7589#issuecomment-663038827


   /pulsarbot run-failure-checks


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui commented on pull request #7589: Fix race condition on the close consumer while reconnecting to the broker.

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on pull request #7589:
URL: https://github.com/apache/pulsar/pull/7589#issuecomment-661510026


   /pulsarbot run-failure-checks


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui commented on pull request #7589: Fix race condition on the close consumer while reconnecting to the broker.

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on pull request #7589:
URL: https://github.com/apache/pulsar/pull/7589#issuecomment-660739508


   /pulsarbot run-failure-checks


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] wolfstudy commented on pull request #7589: Don't try to subscribe to the topic if the consumer is closed.

Posted by GitBox <gi...@apache.org>.
wolfstudy commented on pull request #7589:
URL: https://github.com/apache/pulsar/pull/7589#issuecomment-664092671


   /pulsarbot run-failure-checks


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui commented on pull request #7589: Don't try to subscribe to the topic if the consumer is closed.

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on pull request #7589:
URL: https://github.com/apache/pulsar/pull/7589#issuecomment-662171409


   /pulsarbot run-failure-checks


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] wolfstudy merged pull request #7589: Don't try to subscribe to the topic if the consumer is closed.

Posted by GitBox <gi...@apache.org>.
wolfstudy merged pull request #7589:
URL: https://github.com/apache/pulsar/pull/7589


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org