nodece commented on code in PR #921:
URL: https://github.com/apache/pulsar-client-go/pull/921#discussion_r1057149795


##########
pulsar/consumer_partition.go:
##########
@@ -1134,37 +1144,19 @@ func (pc *partitionConsumer) dispatcher() {
                        go func() {
                                pc.queueCh <- nil
                        }()
+
                        for m := range pc.queueCh {
                                // the queue has been drained
                                if m == nil {
                                        break
                                } else if nextMessageInQueue.Undefined() {
-                                       nextMessageInQueue = 
m[0].msgID.(trackingMessageID)
+                                       nextMessageInQueue, _ = 
toTrackingMessageID(m[0].msgID)
                                }
                        }
 
-                       clearQueueCb(nextMessageInQueue)
-
-               case doneCh := <-pc.clearMessageQueuesCh:
-                       for len(pc.queueCh) > 0 {
-                               <-pc.queueCh
-                       }
-                       for len(pc.messageCh) > 0 {
-                               <-pc.messageCh
-                       }
                        messages = nil
 
-                       // reset available permits
-                       pc.availablePermits.reset()
-                       initialPermits := uint32(pc.queueSize)
-
-                       pc.log.Debugf("dispatcher requesting initial 
permits=%d", initialPermits)
-                       // send initial permits
-                       if err := pc.internalFlow(initialPermits); err != nil {
-                               pc.log.WithError(err).Error("unable to send 
initial permits to broker")
-                       }
-
-                       close(doneCh)
+                       clearQueueCb(nextMessageInQueue)

Review Comment:
   Do you forget the reset available permits?



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