streamnative / pulsar-client-go

Apache Pulsar Go Client Library
https://pulsar.apache.org/
Apache License 2.0
1 stars 2 forks source link

ISSUE-749: Panic occurred when a producer associated with a KeyBasedBatchBuilder. #267

Open sijie opened 2 years ago

sijie commented 2 years ago

Original Issue: apache/pulsar-client-go#749


Function internalFlushCurrentBatch, this line of code, should not be invoked if the batch builder associated with the producer is a multi batches container.

Potential Fix: Using internalFlushCurrentBatches instead, if the associated batch builder is a multi batches container.

        if p.batchBuilder.IsMultiBatches() {
            p.internalFlushCurrentBatches()
        } else {
            p.internalFlushCurrentBatch()
        }
shileiyu commented 2 years ago

PR: https://github.com/apache/pulsar-client-go/pull/750 CI passed on 2.8.2.