Skip to content
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

[fix][issue 1098] check batchBuilder in case batch is disabled #1099

Merged
merged 2 commits into from
Nov 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pulsar/producer_partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,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