aloyszhang commented on a change in pull request #13055:
URL: https://github.com/apache/pulsar/pull/13055#discussion_r764963912



##########
File path: 
pulsar-broker/src/test/java/org/apache/pulsar/client/impl/TopicDoesNotExistsTest.java
##########
@@ -61,11 +61,11 @@ public void testCreateProducerOnNotExistsTopic() throws 
PulsarClientException, I
                     .sendTimeout(100, TimeUnit.MILLISECONDS)
                     .create();
             Assert.fail("Create producer should failed while topic does not 
exists.");
-        } catch (PulsarClientException ignore) {
+        } catch (PulsarClientException e) {
+            Assert.assertTrue(e instanceof 
PulsarClientException.NotFoundException);
         }
         Thread.sleep(2000);
         HashedWheelTimer timer = (HashedWheelTimer) ((PulsarClientImpl) 
pulsarClient).timer();
-        Assert.assertEquals(timer.pendingTimeouts(), 0);

Review comment:
       The reason as explained  before:
   IF auto-create is not allowed, before this pull request, building a producer 
will get a `CommandError` from the broker which will close the produce this 
will release all the resource in a `ProducerImpl`.
   After this pull request, we will get a `connectionFailed` after lookup the 
brokerUrl, and this failure does not close the produce which will failed the 
test.
   
   To resolve this problem, we should close the `ProducerImpl` at the point 
`connectionFailed`, but this is unreleated with this PR as you said.
   
   I think it's better to open a new issue to handle resource releasing when 
`connectionFailed`.




-- 
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]


Reply via email to