Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed deadlock in DLQ ack processing #375

Merged
merged 1 commit into from
Oct 1, 2020

Conversation

merlimat
Copy link
Contributor

@merlimat merlimat commented Oct 1, 2020

Motivation

When acking the original message, after sending to the DLQ, there is a potential deadlock if the producer is sharing the same connection as the consumer. The problem is we're trying to write on the connection event channel from the same go-routine that's handling the connection.

1 @ 0x4038f00 0x400774d 0x4007515 0x4606e8d 0x4613487 0x4603456 0x461cf4c 0x4619ab8 0x45f8bde 0x45f805e 0x45f737d 0x45fed61 0x4068bb1
#	0x4606e8c	github.com/apache/pulsar-client-go/pulsar.(*partitionConsumer).AckID+0x25c			/Users/mmerli/go/src/github.com/apache/pulsar-client-go/pulsar/consumer_partition.go:279
#	0x4613486	github.com/apache/pulsar-client-go/pulsar.trackingMessageID.Ack+0x106				/Users/mmerli/go/src/github.com/apache/pulsar-client-go/pulsar/impl_message.go:55
#	0x4603455	github.com/apache/pulsar-client-go/pulsar.(*consumer).AckID+0x165				/Users/mmerli/go/src/github.com/apache/pulsar-client-go/pulsar/consumer_impl.go:371
#	0x461cf4b	github.com/apache/pulsar-client-go/pulsar.(*dlqRouter).run.func1+0x19b				/Users/mmerli/go/src/github.com/apache/pulsar-client-go/pulsar/dlq_router.go:104
#	0x4619ab7	github.com/apache/pulsar-client-go/pulsar.(*partitionProducer).ReceivedSendReceipt+0x3a7	/Users/mmerli/go/src/github.com/apache/pulsar-client-go/pulsar/producer_partition.go:510
#	0x45f8bdd	github.com/apache/pulsar-client-go/pulsar/internal.(*connection).handleSendReceipt+0xed		/Users/mmerli/go/src/github.com/apache/pulsar-client-go/pulsar/internal/connection.go:599
#	0x45f805d	github.com/apache/pulsar-client-go/pulsar/internal.(*connection).internalReceivedCommand+0x1cd	/Users/mmerli/go/src/github.com/apache/pulsar-client-go/pulsar/internal/connection.go:518
#	0x45f737c	github.com/apache/pulsar-client-go/pulsar/internal.(*connection).run+0x33c			/Users/mmerli/go/src/github.com/apache/pulsar-client-go/pulsar/internal/connection.go:378
#	0x45fed60	github.com/apache/pulsar-client-go/pulsar/internal.(*connection).start.func1+0x70		/Users/mmerli/go/src/github.com/apache/pulsar-client-go/pulsar/internal/connection.go:231

@merlimat merlimat added this to the 0.3.0 milestone Oct 1, 2020
@merlimat merlimat self-assigned this Oct 1, 2020
merlimat added a commit to merlimat/pulsar-client-go that referenced this pull request Oct 1, 2020
@srkukarni srkukarni merged commit 6f646aa into apache:master Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants