-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] The capacity of dataChan is too big #1067
Comments
What does it mean? Both dataChan: make(chan *sendRequest, maxPendingMessages),
publishSemaphore: internal.NewSemaphore(int32(maxPendingMessages)), |
Because we acquire publishSemaphore after the consumption of dataChan. In some cases we may need to keep twice the number of MaxPendingMessages messages in memory. And it will break the producer memory limit. pulsar-client-go/pulsar/producer_partition.go Lines 1221 to 1224 in 793008e
pulsar-client-go/pulsar/producer_partition.go Lines 443 to 448 in 793008e
pulsar-client-go/pulsar/producer_partition.go Lines 486 to 493 in 793008e
But the concept here is a bit vague. MaxPendingMessages actually limits messages that are being sent to the broker but have not received ack. It actually has nothing to do with producer memory limit, but it affects the accuracy of mem limit because of the execution order. So I think it's better to reduce the size of datachan. What do you think? |
Hi community. I noticed that the capacity of dataChan is too big. We make the
dataChan
with capacityMaxPendingMessages
and the account of pending messages actual in queue may exceed the limit byMaxPendingMessages
a lot.This is because we use
publishSemaphore
instead of capacity ofdataChan
to limit pending messages. The actual limit is 2X ofMaxPendingMessages
.pulsar-client-go/pulsar/producer_partition.go
Line 148 in 9867c29
The text was updated successfully, but these errors were encountered: