Impala Public Jenkins has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/15218 )

Change subject: IMPALA-9383: Fix hang in hs2-http server with large, chunks 
request
......................................................................

IMPALA-9383: Fix hang in hs2-http server with large, chunks request

The issue is that in each call to THttpTransport::read(), it always
starts by calling refill(), which tries to read more data off the
socket, but for chunked requests each call to read() only processes a
single chunk.

So, if more than one chunk is read off the socket at a time (which
happens with large requests due to an algorithm that increases the
amount of data read off the socket with each read), you can end up
with more chunks still needing to be processed but no more data to
read off the socket, and the next call to THttpTransport::read() will
hang when it calls refill().

The solution is to not always call refill() at the beginning of each
call to THttpTransport::read(). This works because the functions that
actually process the data, readLine() and readContent() will call
refill() themselves anyways if they actually need more data.

Testing:
- Added a BE test that uses curl to send chunked requests to the hs2
  http server.

Change-Id: If822fb9cd2d7f2b0f5e36879fd7ccbba9a217ad0
Reviewed-on: http://gerrit.cloudera.org:8080/15218
Reviewed-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
---
M be/src/rpc/CMakeLists.txt
R be/src/rpc/hs2-http-test.cc
M be/src/transport/THttpTransport.cpp
3 files changed, 65 insertions(+), 9 deletions(-)

Approvals:
  Impala Public Jenkins: Looks good to me, approved; Verified

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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: If822fb9cd2d7f2b0f5e36879fd7ccbba9a217ad0
Gerrit-Change-Number: 15218
Gerrit-PatchSet: 3
Gerrit-Owner: Thomas Tauber-Marshall <tmarsh...@cloudera.com>
Gerrit-Reviewer: David Rorke <dro...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com>

Reply via email to