BewareMyPower commented on PR #16171:
URL: https://github.com/apache/pulsar/pull/16171#issuecomment-1168351385

   Yes this PR fixes the race condition when `seek` is called after 
`subscribe`, but I think there is another bug that `subscribe` doesn't looks 
like a synchronous operation. Without this PR, the test could still pass after 
sleeping for a while before `seek`.
   
   ```java
           org.apache.pulsar.client.api.Consumer<String> consumer = pulsarClient
                   .newConsumer(Schema.STRING).startMessageIdInclusive()
                   .topics(Arrays.asList(topicName, 
topicName2)).subscriptionName("my-sub").subscribe();
   
           Thread.sleep(2000);
   
           consumer.seek((partitionedTopic) -> {
   ```
   
   I think the root cause is that `MultiTopicsConsumerImpl#subscribeFuture()` 
completed too early.


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