apache / pulsar-client-go

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

When the topic is deleted, call consumer.Close() program panic #1001

Open szmikemai opened 1 year ago

szmikemai commented 1 year ago
  1. client.Subscribe create consumer
  2. delete the topic on the console
  3. consumer call Close() close the consumer and panic

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

goroutine 54085 [running]: mq-proxy/vendor/github.com/apache/pulsar-client-go/pulsar.(partitionConsumer).getConsumerState(...) /var/jenkins_home/workspace/cci-905269-131348/ci-workspace/src/mq-proxy/vendor/github.com/apache/pulsar-client-go/pulsar/consumer_partition.go:466 mq-proxy/vendor/github.com/apache/pulsar-client-go/pulsar.(partitionConsumer).Close(...) /var/jenkins_home/workspace/cci-905269-131348/ci-workspace/src/mq-proxy/vendor/github.com/apache/pulsar-client-go/pulsar/consumer_partition.go:475 cmq-proxy/vendor/github.com/apache/pulsar-client-go/pulsar.(consumer).Close.func1.1(0xc000377260) /var/jenkins_home/workspace/cci-905269-131348/ci-workspace/src/mq-proxy/vendor/github.com/apache/pulsar-client-go/pulsar/consumer_impl.go:568 +0x54 created by mq-proxy/vendor/github.com/apache/pulsar-client-go/pulsar.(consumer).Close.func1 /var/jenkins_home/workspace/cci-905269-131348/ci-workspace/src/mq-proxy/vendor/github.com/apache/pulsar-client-go/pulsar/consumer_impl.go:566 +0xb9

This is unreasonable. For example, the administrator deletes a user, the user loginout, causing the system to crash

shibd commented 1 year ago

@szmikemai I can't reproduce on my local host.

Can you share more context? client-version, step, etc.