pulsar-client-go icon indicating copy to clipboard operation
pulsar-client-go copied to clipboard

[BUG] The capacity of dataChan is too big

Open Gleiphir2769 opened this issue 1 year ago • 2 comments

Hi community. I noticed that the capacity of dataChan is too big. We make the dataChan with capacity MaxPendingMessages and the account of pending messages actual in queue may exceed the limit by MaxPendingMessages a lot.

This is because we use publishSemaphore instead of capacity of dataChan to limit pending messages. The actual limit is 2X of MaxPendingMessages.

https://github.com/apache/pulsar-client-go/blob/9867c29ca329302e97ddd9c6a99f66853c7f447f/pulsar/producer_partition.go#L148

Gleiphir2769 avatar Jul 21 '23 19:07 Gleiphir2769