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 2019/07/02 02:58:04 UTC

[GitHub] [pulsar] easyfan opened a new issue #4656: C++ client producer sendAsync() timeout check method seems too arbitrary

easyfan opened a new issue #4656: C++ client producer sendAsync() timeout check method seems too arbitrary
URL: https://github.com/apache/pulsar/issues/4656
 
 
   **C++ client producer sendAsync() timeout check method seems too arbitrary**
   
   
   **Analysis**
   In general, the c++ client producer timeout check was implemented in pulsar/pulsar-client-cpp/lib/ProducerImpl.cc, `ProducerImpl::handleSendTimeout(...)`, which is registered as a handler of `ProducerImpl::sendTimer_`;
   In any performing phase of `ProducerImpl::sendTimer_`, the very first `pulsar::OpSendMsg` element inside `ProducerImpl::pendingMessagesQueue_` will be picked up and compare the  OpSendMsg::timeout_ with current tick. If the time diff is less than 0, there is a sending timeout happens. 
   
   So far so good.
   
   But then, it invokes the method `ProducerImpl::failPendingMessages(...)` for dealing the message failure stuff. Definitely, it works, but not only on the message it already checked as we hoped, but just all the messages inside `ProducerImpl::pendingMessagesQueue_`.
   
   Result: Inside a sending timeout check, if the very oldest message inside the pending queue timeout, will lead all the messages inside the pending queue to be processed as a timeout
   
   **Expected behavior**
   A more specifical check on every message timeout. 
   
   **Desktop (please complete the following information):**
    - OS: centOS
   
   **About the performance**
   As there are much more performing of check and compare than it was, the performance will downgrade undoubtedly. We may have a discussion of it, and make a decision then.
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services