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/18 03:54:48 UTC

[GitHub] [pulsar] massakam opened a new pull request #4750: [Issue #4658][pulsar-client-cpp] Introduce strand to C++ client for exclusive control

massakam opened a new pull request #4750: [Issue #4658][pulsar-client-cpp] Introduce strand to C++ client for exclusive control
URL: https://github.com/apache/pulsar/pull/4750
 
 
   Fixes #4658
   
   ### Motivation
   
   As mentioned in https://github.com/apache/pulsar/issues/4658, if sending and receiving a large number of messages with TLS enabled, C++ client's connection is often closed.
   
   This seems to be because SSL socket provided by Boost.Asio may be corrupted if it is read and written by multiple threads concurrently.
   
   A mechanism called "strand" is typically used to prevent this problem, but the Pulsar client is not currently using it.
   
   - https://stackoverflow.com/questions/18656919/boostasiossl-access-violation-on-multi-threaded-application
   - https://stackoverflow.com/questions/12794107/why-do-i-need-strand-per-connection-when-using-boostasio
   
   ### Modifications
   
   Introduced "strand" to the C++ client so that reading and writing on the SSL socket are not performed simultaneously. By making this change, the phenomenon that the connection is often closed is no longer reproduced.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.

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