BewareMyPower edited a comment on issue #509:
URL: https://github.com/apache/pulsar/issues/509#issuecomment-1074741277


   Here is the reproduce code.
   
   ```c++
   #include <pulsar/Client.h>
   #include <chrono>
   #include <thread>
   
   using namespace pulsar;
   
   int main() {
       ClientConfiguration conf;
       conf.setLogger(new ConsoleLoggerFactory(Logger::LEVEL_DEBUG));
       Client client("pulsar://localhost:6650", conf);
       {
           Producer producer;
           Result result = client.createProducer("my-topic", producer);
           if (result != ResultOk) {
               return -1;
           }
       }
   
       std::this_thread::sleep_for(std::chrono::seconds(5));
       client.close();
   }
   ```
   
   The destruction happens after the `client.close()` is called. (see the 3rd 
line)
   
   ```
   2022-03-22 13:11:10.064 DEBUG [0x70000debe000] ClientImpl:586 | 
listenerExecutorProvider_ is closed
   2022-03-22 13:11:10.064 DEBUG [0x70000debe000] ClientImpl:588 | 
partitionListenerExecutorProvider_ is closed
   2022-03-22 13:11:10.064 DEBUG [0x70000debe000] ProducerImpl:110 | 
[persistent://public/default/my-topic, standalone-5-1] ~ProducerImpl
   2022-03-22 13:11:10.064 INFO  [0x70000debe000] ProducerImpl:653 | Producer - 
[persistent://public/default/my-topic, standalone-5-1] , [batchMessageContainer 
= { BatchMessageContainer [size = 0] [bytes = 0] [maxSize = 1000] [maxBytes = 
131072] [topicName = persistent://public/default/my-topic] 
[numberOfBatchesSent_ = 1] [averageBatchSize_ = 0] }]
   ```


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