Jason918 commented on a change in pull request #12900:
URL: https://github.com/apache/pulsar/pull/12900#discussion_r755757661
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
##########
@@ -1284,11 +1284,20 @@ private void buildProducerAndAddTopic(Topic topic, long
producerId, String produ
boolean userProvidedProducerName, TopicName
topicName,
ProducerAccessMode producerAccessMode,
Optional<Long> topicEpoch,
CompletableFuture<Producer> producerFuture){
+ // Skip acquiring the topic's lock within addProducer if the producer
will fail creation anyway.
+ if (!isActive()) {
+ log.info("[{}] Connection is no longer active. Skipping creation
for produceId={} to topic {}.",
+ remoteAddress, topicName, producerId);
+ return;
Review comment:
Right, that make sense.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]