michaeljmarshall commented on a change in pull request #10159:
URL: https://github.com/apache/pulsar/pull/10159#discussion_r612122925
##########
File path:
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
##########
@@ -938,6 +938,21 @@ private void closeConsumerTasks() {
if (possibleSendToDeadLetterTopicMessages != null) {
possibleSendToDeadLetterTopicMessages.clear();
}
+
+ if (deadLetterProducer != null) {
+ try {
+ createProducerLock.writeLock().lock();
+ if (deadLetterProducer != null) {
+ deadLetterProducer.thenApplyAsync(Producer::closeAsync);
Review comment:
@eolivelli - given that this method incurs a network call to the broker,
I think it'd be preferable to use the `closeAsync`, if possible. I added a
commit to show what I'm thinking. Let me know if this works, or if you'd still
prefer to block.
--
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]