pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] lovelle opened a new pull request #3312: Prevent dup consumers on same client cnx with shared subscription
Date Sun, 06 Jan 2019 14:48:44 GMT
lovelle opened a new pull request #3312: Prevent dup consumers on same client cnx with shared
subscription
URL: https://github.com/apache/pulsar/pull/3312
 
 
   Providing help trying to fix issue #3226. Bug description:
       
   When a client attempts to setup more than one consumer subscription on shared
   mode with the same subscription name, due to the validation at broker level of
   `consumerList.size() == 1` on [canUnsubscribe()](https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java#L342)
method, broker will throw an
   exception at the moment the client tries to unsubscribe the consumer.
   
   In order to prevent this, the proposed solution (probably not the best one) is
   to detect when the user is trying to setup an already subscribed consumer and
   return this exact same consumer instance.
   
   I believe that is quite strange to have two or more consumers with shared mode
   on the same connection for the same subscription, this might be due to the user
   confusing about consumer shared mode or behaviour, another good solution to
   prevent this from happening might be just throwing an invalid configuration
   exception.
   
   ### Motivation
   
   Provide help to #3304 fixing issue #3226 
   
   ### Modifications
   
   Prevent duplicated consumers for shared mode over the same client connection.
   
   ### Result
   
   Fixing #3226 
   
   TODO:
   
   - [ ] Add test exploiting issue.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services

Mime
View raw message