Jean-Daniel Cryans has submitted this change and it was merged.

Change subject: [java client] Fix a race involving the read timeout
......................................................................


[java client] Fix a race involving the read timeout

The ReadTimeoutHandler isn't something we really want (per-RPC timer
would be better than socket read timeout), but some handling that was
added a year ago (01698c3) made things worse. Being the author of that other
patch, I think my fix was misguided.

The race this patch fixes is that some RPCs were able send their payload
on the wire even after cleanup() had run, but before `chan` was set to
null, when a ReadTimeoutException was fired. The proper way is to close
the channel first, then start cleaning up, so that concurrent threads who
process RPCs won't think that we're all good because the channel isn't null.

I'm easily able to repro this on a cluster with a 1s read timeout along
with ITBLL.

Change-Id: I486fb4c099a9f110f17b4bc72e48d91f258ee044
Reviewed-on: http://gerrit.cloudera.org:8080/3724
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <a...@cloudera.com>
---
M java/kudu-client/src/main/java/org/kududb/client/TabletClient.java
1 file changed, 1 insertion(+), 4 deletions(-)

Approvals:
  Adar Dembo: Looks good to me, approved
  Kudu Jenkins: Verified



-- 
To view, visit http://gerrit.cloudera.org:8080/3724
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I486fb4c099a9f110f17b4bc72e48d91f258ee044
Gerrit-PatchSet: 3
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Jean-Daniel Cryans <jdcry...@apache.org>
Gerrit-Reviewer: Adar Dembo <a...@cloudera.com>
Gerrit-Reviewer: Dan Burkert <d...@cloudera.com>
Gerrit-Reviewer: Jean-Daniel Cryans <jdcry...@apache.org>
Gerrit-Reviewer: Kudu Jenkins

Reply via email to