flowchartsman opened a new issue, #897:
URL: https://github.com/apache/pulsar-client-go/issues/897
```go
producer, err := client.CreateProducer(ProducerOptions{
Topic: newTopicName(),
DisableBatching: true,
})
ID, err := producer.Send(context.Background(), &ProducerMessage{
Payload: []byte("hello"),
})
producer.Flush()
```
```
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x1005cf756]
goroutine 13 [running]:
github.com/apache/pulsar-client-go/pulsar.(*partitionProducer).internalFlushCurrentBatch(0xc0007bc240)
/Users/me/go/pkg/mod/github.com/apache/[email protected]/pulsar/producer_partition.go:810
+0x36
github.com/apache/pulsar-client-go/pulsar.(*partitionProducer).internalFlush(0xc0007bc240,
0xc0006d6018)
/Users/me/go/pkg/mod/github.com/apache/[email protected]/pulsar/producer_partition.go:992
+0x3e
github.com/apache/pulsar-client-go/pulsar.(*partitionProducer).runEventsLoop(0xc0007bc240)
/Users/me/go/pkg/mod/github.com/apache/[email protected]/pulsar/producer_partition.go:452
+0x114
created by github.com/apache/pulsar-client-go/pulsar.newPartitionProducer
/Users/me/go/pkg/mod/github.com/apache/[email protected]/pulsar/producer_partition.go:201
+0xaf6
```
#### Expected behavior
NOP?
#### Actual behavior
Panic
This is because `partitionProducer.internalFlushCurrentBatch()` is called
without checking to see if `partitionProducer.batchBuilder` is nil.
--
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]