From f6198df59753ae1b7b671817ac2d3726dcd69741 Mon Sep 17 00:00:00 2001 From: Matteo Merli Date: Thu, 18 Jun 2020 11:40:20 -0700 Subject: [PATCH] Use maxPendingMessages for sizing producer eventsChan (#285) --- pulsar/producer_partition.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pulsar/producer_partition.go b/pulsar/producer_partition.go index 0f3d1983bc..31c2bd11d5 100644 --- a/pulsar/producer_partition.go +++ b/pulsar/producer_partition.go @@ -92,7 +92,7 @@ func newPartitionProducer(client *client, topic string, options *ProducerOptions topic: topic, options: options, producerID: client.rpcClient.NewProducerID(), - eventsChan: make(chan interface{}, 10), + eventsChan: make(chan interface{}, maxPendingMessages), batchFlushTicker: time.NewTicker(batchingMaxPublishDelay), publishSemaphore: make(internal.Semaphore, maxPendingMessages), pendingQueue: internal.NewBlockingQueue(maxPendingMessages),