Jean-Daniel Cryans has uploaded a new change for review.

  http://gerrit.cloudera.org:8080/3340

Change subject: [java client] Fix a race in TabletClient cleanup
......................................................................

[java client] Fix a race in TabletClient cleanup

Dan noticed some weird things going on after fixing 
TestAsyncKuduClient#testDisconnect,
we're either not handling some RPCs or doing it twice.

The reason is that we add to rpcs_inflight directly without caring for the 
state of
TabletClient (if it's connected or not). Later, we try to detect if we got 
disconnected
but there was no easy way to tell if our RPC was already retried for us or not.

This patch tries to make it clear whether the RPC at the end of 
TabletClient#sendRpc
is already handled or not: if the TabletClient is dead, and the rpcs_inflight 
list is
empty, then it got taken care of. If it's not empty, then it means the RPC 
needs to
be sent back to the AsyncKuduClient.

This patch fixes flakiness in the test mentioned above.

Change-Id: Ic87425bd54e01a50c3fc11f2862a3e5f737f2bf7
---
M java/kudu-client/src/main/java/org/kududb/client/TabletClient.java
1 file changed, 32 insertions(+), 18 deletions(-)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic87425bd54e01a50c3fc11f2862a3e5f737f2bf7
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Jean-Daniel Cryans

Reply via email to