Skip to content

Commit

Permalink
[fix][issue 1098] check batchBuilder in case batch is disabled (#1099)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzming authored Nov 1, 2023
1 parent 620ecf4 commit 0845e73
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pulsar/producer_partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,13 @@ type pendingItem struct {
}

func (p *partitionProducer) internalFlushCurrentBatch() {
if p.batchBuilder == nil {
// batch is not enabled
// the batch flush ticker should be stopped but it might still called once
// depends on when stop() is called concurrently
// so we add check to prevent the flow continues on a nil batchBuilder
return
}
if p.batchBuilder.IsMultiBatches() {
p.internalFlushCurrentBatches()
return
Expand Down

0 comments on commit 0845e73

Please sign in to comment.