jiangbo9510 commented on a change in pull request #530:
URL: https://github.com/apache/pulsar-client-go/pull/530#discussion_r643263650
##########
File path: pulsar/producer_partition.go
##########
@@ -490,21 +490,36 @@ func (p *partitionProducer) failTimeoutMessages() {
// iterate at most viewSize items
for i := 0; i < viewSize; i++ {
- item := p.pendingQueue.Poll()
+ tickerNeedWaiting := time.Duration(0)
+ item := p.pendingQueue.CompareAndPoll(
Review comment:
> This should also be used to refactor the `pendingQueue.Peek()` at line
464
@merlimat There is not necessarily. pendingQueue.Peek()` at line 464 is to
check the first item of queue whether timeout. It not modify the queue.
--
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:
[email protected]