You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2020/06/17 23:45:19 UTC

[pulsar-client-go] branch master updated: Fix unable to close consumer after unsubscribe in Shared Subscription (#283)

This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-client-go.git


The following commit(s) were added to refs/heads/master by this push:
     new 1e00fb6  Fix unable to close consumer after unsubscribe in Shared Subscription (#283)
1e00fb6 is described below

commit 1e00fb65e7c232e92d9ca11df8f93888cb39ee64
Author: C_G <cg...@gmail.com>
AuthorDate: Thu Jun 18 07:45:12 2020 +0800

    Fix unable to close consumer after unsubscribe in Shared Subscription (#283)
---
 pulsar/consumer_partition.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pulsar/consumer_partition.go b/pulsar/consumer_partition.go
index 4c40ae9..15e0c6b 100644
--- a/pulsar/consumer_partition.go
+++ b/pulsar/consumer_partition.go
@@ -184,6 +184,10 @@ func (pc *partitionConsumer) internalUnsubscribe(unsub *unsubscribeRequest) {
 	if err != nil {
 		pc.log.WithError(err).Error("Failed to unsubscribe consumer")
 		unsub.err = err
+		// Set the state to ready for closing the consumer
+		pc.state = consumerReady
+		// Should'nt remove the consumer handler
+		return
 	}
 
 	pc.conn.DeleteConsumeHandler(pc.consumerID)