merlimat opened a new pull request, #17658:
URL: https://github.com/apache/pulsar/pull/17658

   ### Motivation
   
   The C++ client is waiting to receive a `Pong` response from broker and if 
it's not received within 30 seconds, it will forcefully close the connection, 
assuming the broker is unresponsive. 
   
   Java client was changed, a long time ago, to reset the 
`havePendingPingRequest` every time some data is read from the socket, instead 
of just when receiving the Ping response.
   
   In C++, what can happen is that if there is a lot of messages being sent to 
the broker, and consequently lot of responses from the broker, ***and*** the 
application callbacks are taking long time (either blocking or just using a lot 
of CPU), then the Ping response might be sitting behind a lot of broker replies 
and it might take more than 30 seconds to actually process it.
   
   During this time, we are still reading data from the socket and we shouldn't 
be considering the connection dead.
   
   ### Modifications
   
   In the C++ client, use the same logic used for Java client and treat any 
data read from the connection as a signal that the connection is healthy.
   
   


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