Alexey Serbin has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/8328


Change subject: WIP: [tls_socket] retry IO on SSL_ERROR_WANT_{READ,WRITE}
......................................................................

WIP: [tls_socket] retry IO on SSL_ERROR_WANT_{READ,WRITE}

It seems that for some versions of the OpenSSL library, SSL_read()
and SSL_write() functions return SSL_ERROR_WANT_READ and
SSL_ERROR_WANT_WRITE correspondingly even if SSL_MODE_AUTO_RETRY mode
is set the SSL context.

This changelist addresses that.  Also, it fixes the flakiness in
ClientStressTest.TestUniqueClientIds scenario.  Prior to this fix,
the test failure ratio observed with dist-test for TSAN builds was
about 6% in multiple 1K runs.  After the fix, no failures observed.

The test was failing with errors like the following:
  Bad status: IO error: Could not connect to the cluster: \
    Client connection negotiation failed: client connection to \
    IP:port: Read zero bytes on a blocking Recv() call: \
    Transferred 0 of 4 bytes

WIP: Need to clarify on exact versions of the OpenSSL library.

WIP: This patch assumes that that the only use case for
     TlsSocket::Write() and TlsSocket:Recv() is with SSL_MODE_AUTO_RETRY
     always set for the SSL context.  So, I'm collecting some feedback
     on this approach.

WIP: An alternative approach might be returning special error code
     from TlsSocket::Write() and TlsSocket::Recv() and processing that
     correspondingly in Socket::BlockingWrite() and
     Socket::BlockingRecv() methods.  If that approach is better, I can
     post corresponding changelist for review instead of this.

WIP: Is more straightforward test instead of client-stress-test needed?

Change-Id: I72b2050d1aa683731faa02b2adb360d46cd0f94c
---
M src/kudu/security/tls_socket.cc
1 file changed, 38 insertions(+), 25 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/28/8328/1
--
To view, visit http://gerrit.cloudera.org:8080/8328
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I72b2050d1aa683731faa02b2adb360d46cd0f94c
Gerrit-Change-Number: 8328
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <[email protected]>

Reply via email to