You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/12/28 06:44:19 UTC

[GitHub] [pulsar-client-cpp] RobertIndie commented on a diff in pull request #156: [fix] Fix log for connection disconnected expectedly

RobertIndie commented on code in PR #156:
URL: https://github.com/apache/pulsar-client-cpp/pull/156#discussion_r1058094316


##########
lib/ClientConnection.cc:
##########
@@ -1596,7 +1596,11 @@ void ClientConnection::close(Result result) {
     }
 
     lock.unlock();
-    LOG_INFO(cnxString_ << "Connection closed with " << result);
+    if (result != ResultDisconnected) {
+        LOG_ERROR(cnxString_ << "Connection closed with " << result);

Review Comment:
   Thanks. I changed it to print info log when the result is ResultRetryable.
   > calling close is the expected behavior of the code.
   Many calling of the close is unexpected behavior. such as:
   
   https://github.com/apache/pulsar-client-cpp/blob/5d5ed2acc2e89aed90b593343369f360644440e7/lib/ClientConnection.cc#L485-L491
   
   https://github.com/apache/pulsar-client-cpp/blob/5d5ed2acc2e89aed90b593343369f360644440e7/lib/ClientConnection.cc#L213-L219
   
   https://github.com/apache/pulsar-client-cpp/blob/5d5ed2acc2e89aed90b593343369f360644440e7/lib/ClientConnection.cc#L223-L229
   
   etc...
   



##########
lib/ClientConnection.cc:
##########
@@ -1596,7 +1596,11 @@ void ClientConnection::close(Result result) {
     }
 
     lock.unlock();
-    LOG_INFO(cnxString_ << "Connection closed with " << result);
+    if (result != ResultDisconnected) {
+        LOG_ERROR(cnxString_ << "Connection closed with " << result);

Review Comment:
   Thanks. I changed it to print info log when the result is ResultRetryable.
   > calling close is the expected behavior of the code.
   
   Many calling of the close is unexpected behavior. such as:
   
   https://github.com/apache/pulsar-client-cpp/blob/5d5ed2acc2e89aed90b593343369f360644440e7/lib/ClientConnection.cc#L485-L491
   
   https://github.com/apache/pulsar-client-cpp/blob/5d5ed2acc2e89aed90b593343369f360644440e7/lib/ClientConnection.cc#L213-L219
   
   https://github.com/apache/pulsar-client-cpp/blob/5d5ed2acc2e89aed90b593343369f360644440e7/lib/ClientConnection.cc#L223-L229
   
   etc...
   



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org