youurayy edited a comment on issue #4941: Unable to delete topic when both consumer (subscription) and reader has been connected URL: https://github.com/apache/pulsar/issues/4941#issuecomment-547806673 I can confirm this is an issue: once a Reader as been seen on a topic, it is not possible to delete any Consumer subscription. This is a **massive** issue because it means that we basically cannot use Readers and Consumers combined on a topic, because we will never be able to clean that topic and it will be amassing data forever (until quotas are hit). Here's minimal replication case: - this is a 4 broker Pulsar cluster (in Kubernetes) - accessed via proxied pulsar:// protocol (via the Pulsar Proxy) 1. subscribe with a Consumer, then stop the Consumer 2. delete the subscription with admin tool -- this will work `bin/pulsar-admin topics unsubscribe public/test-seqid/topic-3 -s failover-subscription` 3. subscribe with a Reader, then stop the Reader 4. subscribe with a Consumer, then stop the Consumer 5. delete the subscription with admin tool -- this will **NOT** work (timeout) `bin/pulsar-admin topics unsubscribe public/test-seqid/topic-3 -s failover-subscription`  Client code: ```java pulsar = PulsarClient.builder() .serviceUrl(pulsarUrl) .connectionsPerBroker(1) // default: 1 .connectionTimeout(10, TimeUnit.SECONDS) .enableTcpNoDelay(true) .keepAliveInterval(999, TimeUnit.DAYS) .maxBackoffInterval(5, TimeUnit.SECONDS) .startingBackoffInterval(1, TimeUnit.SECONDS) .statsInterval(60, TimeUnit.SECONDS) .ioThreads(1) // default: 1 .listenerThreads(1) // default: 1 .maxConcurrentLookupRequests(5000) // default: 5000 .maxLookupRequests(50000) // default: 50000 .maxNumberOfRejectedRequestPerConnection(50) // default: 50 .operationTimeout(30, TimeUnit.SECONDS) // default: 30 sec .build(); ``` Consumer code: ```java Consumer<Test> consumer = pulsar .newConsumer(Schema.PROTOBUF(Test.class)) .consumerName("consumer1") .subscriptionInitialPosition(SubscriptionInitialPosition.Latest) .subscriptionType(SubscriptionType.Failover) .subscriptionName("failover-subscription") .topic("persistent://public/test-seqid/topic-3") .subscribe(); while (true) { Message<Test> message = consumer.receive(); ... ``` Reader code: ```java Reader<Test> reader = pulsar .newReader(Schema.PROTOBUF(Test.class)) .readerName("reader1") .topic("persistent://public/test-seqid/topic-3") .startMessageId(MessageId.earliest) .create(); while (true) { Message<Test> message = reader.readNext(); ... ``` (Another separate(?) issue is why the Reader is seeing any previously published data, when retentions on the namespace are zero (both time and size), and all messages were acknowledged. This is confusing.)
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
