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

   Fixes https://github.com/apache/pulsar-client-cpp/issues/483
   
   ### Motivation
   
   When the consumer is during reconnection (e.g. after `seek` is done), the 
`Subscribe` request might be sent to the broker but the connection is not bound 
with the consumer. In this case, `closeAsync` won't send a `CloseConsumer` RPC 
because connection is not available, see 
https://github.com/apache/pulsar-client-cpp/blob/3be5267ef781b9a1928c009da1ac53dc60a12a35/lib/ConsumerImpl.cc#L1355
   
   ### Modifications
   
   Call `setCnx` in `connectionOpened` before sending the `Subscribe` RPC. 
However, after that, `seek` or `hasMessageAvailable` might fail with 
`ResultNotConnected` after reconnection. Hence, add a subscribe promise to 
delay these RPCs after subscribe RPC is done.
   
   Add `testSeekAfterSeek` and `testCloseAfterSeek` to verify the behavior.


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