apache/pulsar-client-go

[bug]: when client can't connect broker, run flush() raise panic

rfyiamcool opened this issue · 0 comments

Expected behavior

async write message to broker with sendAsync, when client can't connect broker, run producer.Flush() raise panic.

Actual behavior

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1004f487d]

goroutine 135 [running]:
sync.(*Once).Do(...)
	/usr/local/go/src/sync/once.go:63
github.com/apache/pulsar-client-go/pulsar.(*partitionProducer).failTimeoutMessages(0xc00018a6c0)
	/Users/ruifengyun/go/pkg/mod/github.com/apache/pulsar-client-go@v0.11.0/pulsar/producer_partition.go:993 +0x6dd
created by github.com/apache/pulsar-client-go/pulsar.newPartitionProducer in goroutine 134
	/Users/ruifengyun/go/pkg/mod/github.com/apache/pulsar-client-go@v0.11.0/pulsar/producer_partition.go:200 +0x97f
FAIL	gitlab.planetmeican.com/titan/logclick-fluentbit/pkg/pulsar	195.365s

Steps to reproduce

First use write some data, and then kill pulsar. When producer.flush is called, this problem will occur.

I see you have solved the problem, please release a new version?

System configuration

pulsar-client-go: v0.11.0