Will Berkeley has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/12758


Change subject: KUDU-2576: TlsSocketTest.TestRecvFailure is flaky
......................................................................

KUDU-2576: TlsSocketTest.TestRecvFailure is flaky

TestRecvFailure wanted the an interleaving of client (main test) thread and
server thread, or something roughly like it:

Server: enters echo (recv -> write) loop
Server: blocking recv
Client: stop the server
Client: blocking write to match server's blocking recv
Server: blocking write
Client: blocking recv to match server's blocking write
Client: blocking recv
Server: exits echo loop and closes connection because it was stopped
Client: blocking recv fails because connection is closed

A sleep was used in the client thread to try to ensure that the server
reached the blocking recv call before the client shut the server down.
However, under TSAN, occasionally the client was able to stop the server
before the server entered the echo loop, so the server closed the
connection before any data could be sent, failing the test.

This patch changes moves the client call to stop the server to after the
first recv-write succeeds, guaranteeing the server is in the echo loop.

Without this patch, I saw 10/2000 runs fail in TSAN with 8 stress
threads. 8 were due to KUDU-2576. With this patch, I saw 4/2000, all of
which were due to a different issue that will be addressed in a
follow-up.

Change-Id: If95576ddc9e1e23f2db904d5b22bc3b9c1522ea4
---
M src/kudu/security/tls_socket-test.cc
1 file changed, 39 insertions(+), 28 deletions(-)



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: If95576ddc9e1e23f2db904d5b22bc3b9c1522ea4
Gerrit-Change-Number: 12758
Gerrit-PatchSet: 1
Gerrit-Owner: Will Berkeley <[email protected]>

Reply via email to