nodece commented on code in PR #1345:
URL: https://github.com/apache/pulsar-client-go/pull/1345#discussion_r2050383469
##########
pulsar/producer_partition.go:
##########
@@ -184,6 +185,7 @@ func newPartitionProducer(client *client, topic string,
options *ProducerOptions
options: options,
producerID: client.rpcClient.NewProducerID(),
dataChan: make(chan *sendRequest, maxPendingMessages),
+ writeChan: make(chan *pendingItem, maxPendingMessages),
Review Comment:
@RobertIndie Once the internal queue reaches its configured capacity
(`maxPendingMessages`), the producer should either block or reject incoming
messages based on the `DisableBlockIfQueueFull` setting:
- If `DisableBlockIfQueueFull` is **`false`**, the producer should **block**
until space becomes available.
- If `DisableBlockIfQueueFull` is **`true`**, the producer should **fail
fast** by rejecting new messages.
Proper backpressure handling is essential to avoid unbounded memory usage
and ensure the system remains responsive under load or during broker
unavailability.
By default, `DisableBlockIfQueueFull` is set to `false`, which means the
producer will block when the number of pending messages exceeds
`maxPendingMessages`. If it is explicitly set to true, the producer will fail
fast with a producer send queue is full error.
I think this topic is different from the current PR and might be better
addressed separately. Let’s keep this PR focused on the specific issue it aims
to resolve.
--
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]