Thomas Tauber-Marshall has uploaded this change for review. ( 
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
---
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(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/18/15218/1
--
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: newchange
Gerrit-Change-Id: If822fb9cd2d7f2b0f5e36879fd7ccbba9a217ad0
Gerrit-Change-Number: 15218
Gerrit-PatchSet: 1
Gerrit-Owner: Thomas Tauber-Marshall <tmarsh...@cloudera.com>

Reply via email to