Andrew Sherman has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/14924


Change subject: IMPALA-9240: add HTTP code handling to THttpClient.
......................................................................

IMPALA-9240: add HTTP code handling to THttpClient.

Before this change Impala Shell is not checking HTTP return codes when
using the hs2-http protocol. The shell is sending a request message
(e.g. send_CloseOperation) but the HTTP call to send this message may
fail. This will result in a failure when reading the reply (e.g. in
recv_CloseOperation) as there is no reply data to read. This will
typically result in an 'EOFError'.

In THttpClient.flush() check the HTTP code that is returned after the
HTTP call is made. If the code is not 1XX (informational response) or
2XX (successful) then throw an RPCException.

This change does not contain any attempt to recover from an HTTP failures
but it does allow the failure to be detected and a message to be
printed.

In future it may be possible to retry after certain HTTP errors.

Testing:
- Add a new test for impala-shell that tries to connect to an HTTP
  server that always returns a 503 error. Check that an appropriate
  error message is printed.

Change-Id: I3c105f4b8237b87695324d759ffff81821c08c43
---
M shell/impala_client.py
M tests/shell/test_shell_interactive.py
2 files changed, 62 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/24/14924/1
--
To view, visit http://gerrit.cloudera.org:8080/14924
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3c105f4b8237b87695324d759ffff81821c08c43
Gerrit-Change-Number: 14924
Gerrit-PatchSet: 1
Gerrit-Owner: Andrew Sherman <[email protected]>
Gerrit-Reviewer: David Knupp <[email protected]>
Gerrit-Reviewer: Thomas Tauber-Marshall <[email protected]>

Reply via email to