poorbarcode opened a new issue, #15050:
URL: https://github.com/apache/pulsar/issues/15050

   **Describe the bug**
   
   `ServerCnx.handleSubscribe` is not thread safety, when more than one 
request, problem occured: "broker registed the same consumers"
   
   **To Reproduce**
   Steps to reproduce the behavior:
   1. The code files are in the attachment
   2. copy `SubscribeProcessController.java` -> 
${PULSAR_HOME}/pulsar-broker/src/main/java/org/apache/pulsar/
   3. override file `ServerCnx.java` and `ConsumerImpl.java` 
   4. start broker
   5. run this code
   ```
   PulsarClient client = 
PulsarClient.builder()serviceUrl("pulsar://localhost:6650").build();
   Consumer consumer = 
client.newConsumer().topic("my-topic").subscriptionName("my-subscription").subscribe();
   ```
   6. see error log at `SubscribeProcessController.consumerAddFinished` 
   
   **Expected behavior**
   see #14970
   
[SubscribeProcessController.java.txt](https://github.com/apache/pulsar/files/8428751/SubscribeProcessController.java.txt)
   
[ServerCnx.java.txt](https://github.com/apache/pulsar/files/8428750/ServerCnx.java.txt)
   
[ConsumerImpl.java.txt](https://github.com/apache/pulsar/files/8428748/ConsumerImpl.java.txt)
   [log at 
SubscribeProcessController.txt](https://github.com/apache/pulsar/files/8428749/log.at.SubscribeProcessController.txt)
   
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to