zhanglistar opened a new pull request, #548:
URL: https://github.com/apache/pulsar-client-cpp/pull/548

      <!-- Either this PR fixes an issue, -->
   
      Fixes #530
   
      <!-- or this PR is one task of an issue -->
   
      ### Motivation
   
      When Python/C++ bindings create C++ ProducerImpl/ConsumerImpl objects and 
the Python interpreter shuts down, C++ destructors may run after the client is 
already closed.
      This causes logging attempts during static/global cleanup which is 
dangerous because logging systems might already be torn down. Issue #530 
identified this problem: "We
      should not print logs after client is closed".
   
      ### Modifications
   
      1. Changed ProducerImpl::printStats() from LOG_INFO to LOG_DEBUG
      2. Added client existence checks in ProducerImpl destructor before 
logging warnings
      3. Added client existence checks in ConsumerImpl destructor before 
logging warnings
      4. Downgraded ConsumerImpl race condition closure log from INFO to DEBUG
      5. When client is already destroyed, log at DEBUG level instead of WARN
   
      ### Verifying this change
   
      - [ ] Make sure that the change passes the CI checks.
   
      This change is already covered by existing tests, such as ProducerTest 
and ConsumerTest which exercise producer/consumer lifecycle.


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