You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/06/01 16:34:00 UTC

[GitHub] [pulsar-client-go] ideadsnow commented on a change in pull request #530: [Issue 527] fix send goroutine blocked

ideadsnow commented on a change in pull request #530:
URL: https://github.com/apache/pulsar-client-go/pull/530#discussion_r643272640



##########
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:
       the bug reason is peek head item and determine if it timeout, and then get a snapshot of pendingQueue, range snapshot and poll all the items in snapshot even if it is not all timeout.
   the pendingQueue.Peek() at line 464 just peek(not poll) the head item in queue and check(logically correct), there are no actual operation to pendingQueue, so it looks like no need to refactor




-- 
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:
users@infra.apache.org