Problem disposing consumer of partitioned topic
See original GitHub issueI’m seeing an exception with the CancellationTokenSource
when trying to dispose a partitioned consumer.
When this happens, it seems to deadlock my process. I assume this is because of the sub-consumers for each partition.
I’m just doing a await consumer.DisposeAsync();
with nothing special. My topic has 10 partitions and I can reproduce this problem against an empty queue. The cancellation needs to be triggered after the consumer gets to the mt/consumer(0, topic) created
log message to reproduce.
System.InvalidOperationException: An attempt was made to transition a task to a final state when it had al
ready completed.
at System.Threading.Tasks.TaskCompletionSource`1.SetException(Exception exception)
at Pulsar.Client.Api.MultiTopicsConsumerImpl`1.stopConsumer()
at <StartupCode$Pulsar-Client>.$MultiTopicsConsumerImpl.-ctor@606-98.MoveNext()
2023-06-29 12:57:07 "HOSTNAME" [INF] [PulsarLogger] [{}] consumer(1, topic, 0) mailbox has stopped normal
ly
2023-06-29 12:57:07 "HOSTNAME" [FTL] [PulsarLogger] [{}] mt/consumer(0, topic) mailbox failure
System.ObjectDisposedException: The CancellationTokenSource has been disposed.
at System.Threading.CancellationTokenSource.ThrowObjectDisposedException()
at Pulsar.Client.Api.MultiTopicsConsumerImpl`1.stopConsumer()
at <StartupCode$Pulsar-Client>.$MultiTopicsConsumerImpl.-ctor@606-98.MoveNext()
Issue Analytics
- State:
- Created 3 months ago
- Comments:8
Top Results From Across the Web
Consumer not reading from new partitions of a topic
I increased the number of partitions for a topic from 10 to 20 and have one kafka connect(consumer) for that topic.
Read more >Consumer stuck while reading from partitioned topic using ...
I am investigating a case in which the consumer is stuck while there are still many messages to read from a partitioned topic....
Read more >Solved: Kafka consumer group lag in one or two partition e...
Hi,. I have a strange problem at kafka channel topic like kafka consumer group lag( 15 lacs events) in one or two partition...
Read more >Work with consumer - Apache Pulsar
If the topic is partitioned, the first consumer subscribes to all partitioned topics, and other consumers are not assigned with partitions and receive...
Read more >Synchronize Different Consumers of the Same Kafka Topic
When Service-A polls a message from the topic, it should first extract the partition and offset of this message. Then, it calls Kafka...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Lanayx Just tested it out. It’s working as expected now. Thanks!
I can reproduce against net6 and net7 on Linux. I haven’t tried reproducing on net48 on Windows.