Gleiphir2769 commented on issue #1067: URL: https://github.com/apache/pulsar-client-go/issues/1067#issuecomment-1778948276
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. https://github.com/apache/pulsar-client-go/blob/793008e7f3b233bfa64e8c22b7cabe10aa334bdb/pulsar/producer_partition.go#L1221-L1224 https://github.com/apache/pulsar-client-go/blob/793008e7f3b233bfa64e8c22b7cabe10aa334bdb/pulsar/producer_partition.go#L443-L448 https://github.com/apache/pulsar-client-go/blob/793008e7f3b233bfa64e8c22b7cabe10aa334bdb/pulsar/producer_partition.go#L486-L493 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? -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
