[Impala-ASF-CR] IMPALA-7943: Bump the default client timeout set on impala-shell

2018-12-06 Thread Anuj Phadke (Code Review)
Anuj Phadke has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/12051 )

Change subject: IMPALA-7943: Bump the default client timeout set on impala-shell
..


Patch Set 1:

1. opened a listening socket in one terminal
#anuj@anuj-OptiPlex-9020:~/Impala$ netcat -l 12345

2. Ran the shell in an another window -
anuj@anuj-OptiPlex-9020:~/Impala$ time ./bin/impala-shell.sh --ssl -i 
localhost:12345 -q "show tables"
Starting Impala Shell without Kerberos authentication
SSL is enabled. Impala server certificates will NOT be verified (set --ca_cert 
to change)
/home/anuj/Impala/toolchain/thrift-0.9.3-p4/python/lib/python2.7/site-packages/thrift/transport/TSSLSocket.py:80:
 DeprecationWarning: 3th positional argument is deprecated. Use keyward 
argument insteand.
  DeprecationWarning)
/home/anuj/Impala/toolchain/thrift-0.9.3-p4/python/lib/python2.7/site-packages/thrift/transport/TSSLSocket.py:80:
 DeprecationWarning: 4th positional argument is deprecated. Use keyward 
argument insteand.
  DeprecationWarning)
/home/anuj/Impala/toolchain/thrift-0.9.3-p4/python/lib/python2.7/site-packages/thrift/transport/TSSLSocket.py:80:
 DeprecationWarning: 5th positional argument is deprecated. Use keyward 
argument insteand.
  DeprecationWarning)
/home/anuj/Impala/toolchain/thrift-0.9.3-p4/python/lib/python2.7/site-packages/thrift/transport/TSSLSocket.py:216:
 DeprecationWarning: validate is deprecated. Use cert_reqs=ssl.CERT_NONE instead
  DeprecationWarning)
No handlers could be found for logger "thrift.transport.TSSLSocket"
Error connecting: TTransportException, Could not connect to localhost:12345: 
_ssl.c:495: The handshake operation timed out
Not connected to Impala, could not execute queries.

real1m0.228s
user0m0.132s
sys 0m0.040s


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc40069e86cbf93634320804efba003fb5551afe
Gerrit-Change-Number: 12051
Gerrit-PatchSet: 1
Gerrit-Owner: Anuj Phadke 
Gerrit-Reviewer: Anuj Phadke 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Lars Volker 
Gerrit-Reviewer: Michael Ho 
Gerrit-Comment-Date: Fri, 07 Dec 2018 03:01:44 +
Gerrit-HasComments: No


[Impala-ASF-CR] IMPALA-7943: Bump the default client timeout set on impala-shell

2018-12-06 Thread Anuj Phadke (Code Review)
Anuj Phadke has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/12051


Change subject: IMPALA-7943: Bump the default client timeout set on impala-shell
..

IMPALA-7943: Bump the default client timeout set on impala-shell

As part of IMPALA-7555, we added a default socket timeout of 5 seconds
when connecting to an impalad. Under heavy load with kerberos and SSL
enabled, we could hit this default timeout. This change bumps up the
timeout to 60 secs to make the impala-shell more robust.

Change-Id: Ifc40069e86cbf93634320804efba003fb5551afe
---
M shell/impala_client.py
M shell/impala_shell_config_defaults.py
2 files changed, 2 insertions(+), 2 deletions(-)



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifc40069e86cbf93634320804efba003fb5551afe
Gerrit-Change-Number: 12051
Gerrit-PatchSet: 1
Gerrit-Owner: Anuj Phadke 


[Impala-ASF-CR] IMPALA-7555: Set socket timeout in impala-shell

2018-10-17 Thread Anuj Phadke (Code Review)
Anuj Phadke has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/11540 )

Change subject: IMPALA-7555: Set socket timeout in impala-shell
..


Patch Set 10:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/11540/9//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/11540/9//COMMIT_MSG@16
PS9, Line 16: 1. Added a test where I create a random listening socket.
> This list should also mention the automatic test added in this change.
Done


http://gerrit.cloudera.org:8080/#/c/11540/9/tests/shell/test_shell_commandline.py
File tests/shell/test_shell_commandline.py:

http://gerrit.cloudera.org:8080/#/c/11540/9/tests/shell/test_shell_commandline.py@770
PS9, Line 770:   # maximum number of queued connections on this socket is 1.
 :   s.listen(1)
> Is this needed?
listen takes 1 value by default
E   TypeError: listen() takes exactly one argument

Do you want me to choose some other value?



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I130fc47f7a83f591918d6842634b4e5787d00813
Gerrit-Change-Number: 11540
Gerrit-PatchSet: 10
Gerrit-Owner: Anuj Phadke 
Gerrit-Reviewer: Anuj Phadke 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Lars Volker 
Gerrit-Reviewer: Michael Ho 
Gerrit-Reviewer: Thomas Marshall 
Gerrit-Comment-Date: Wed, 17 Oct 2018 20:42:47 +
Gerrit-HasComments: Yes


[Impala-ASF-CR] IMPALA-7555: Set socket timeout in impala-shell

2018-10-17 Thread Anuj Phadke (Code Review)
Hello Michael Ho, Thomas Marshall, Lars Volker, Impala Public Jenkins,

I'd like you to reexamine a change. Please visit

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

to look at the new patch set (#10).

Change subject: IMPALA-7555: Set socket timeout in impala-shell
..

IMPALA-7555: Set socket timeout in impala-shell

impala-shell does not set any socket timeout while connecting to the
impala server. This change sets a timeout on the socket before
connecting and unsets it back after successfully connecting. The default
timeout on this socket is 5 sec.
Usage: impala-shell --client_connect_timeout=

Testing:
1. Added a test where I create a random listening socket.
impala-shell (with ssl enabled) connects to this socket and
times out after 2 sec.

2. Created a kerberized impala cluster with ssl enabled and
connected to the impalad using an openssl client (block the
beeswax server thread to accept new connection) -

E.g. - openssl s_client -connect :21000
Used impala-shell to connect to the same impalad later.
impala-shell timed out after the default of 5 sec.I verified
it manually.

Change-Id: I130fc47f7a83f591918d6842634b4e5787d00813
---
M shell/impala_client.py
M shell/impala_shell.py
M shell/impala_shell_config_defaults.py
M shell/option_parser.py
M tests/shell/test_shell_commandline.py
5 files changed, 52 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/40/11540/10
--
To view, visit http://gerrit.cloudera.org:8080/11540
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I130fc47f7a83f591918d6842634b4e5787d00813
Gerrit-Change-Number: 11540
Gerrit-PatchSet: 10
Gerrit-Owner: Anuj Phadke 
Gerrit-Reviewer: Anuj Phadke 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Lars Volker 
Gerrit-Reviewer: Michael Ho 
Gerrit-Reviewer: Thomas Marshall 


[Impala-ASF-CR] IMPALA-7555: Set socket timeout in impala-shell

2018-10-16 Thread Anuj Phadke (Code Review)
Anuj Phadke has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/11540 )

Change subject: IMPALA-7555: Set socket timeout in impala-shell
..


Patch Set 9:

(6 comments)

http://gerrit.cloudera.org:8080/#/c/11540/8/shell/impala_client.py
File shell/impala_client.py:

http://gerrit.cloudera.org:8080/#/c/11540/8/shell/impala_client.py@265
PS8, Line 265: if self.verbose:
> This message seems misleading, given that the client has its own notion of
Done


http://gerrit.cloudera.org:8080/#/c/11540/8/shell/impala_client.py@266
PS8, Line 266:   print_to_stderr('Opened TCP connection to %s:%s' % 
(self.impalad_host,
> "on sockets."
Done


http://gerrit.cloudera.org:8080/#/c/11540/6/shell/impala_shell.py
File shell/impala_shell.py:

http://gerrit.cloudera.org:8080/#/c/11540/6/shell/impala_shell.py@816
PS6, Line 816:   raise
> I think we should keep this, see my comment elsewhere
Done


http://gerrit.cloudera.org:8080/#/c/11540/8/shell/impala_shell.py
File shell/impala_shell.py:

http://gerrit.cloudera.org:8080/#/c/11540/8/shell/impala_shell.py@1510
PS8, Line 1510:   """Replaces variable within the string with their 
corresponding values using the
> nit: indent
Done


http://gerrit.cloudera.org:8080/#/c/11540/8/shell/impala_shell.py@1540
PS8, Line 1540: def get_var_name(name):
> While you're here, "Looks", "Returns"
Done


http://gerrit.cloudera.org:8080/#/c/11540/6/tests/shell/test_shell_commandline.py
File tests/shell/test_shell_commandline.py:

http://gerrit.cloudera.org:8080/#/c/11540/6/tests/shell/test_shell_commandline.py@737
PS6, Line 737:but doing this reliably on different Linux distributions 
is quite hard.
> Where did this go?
This test hung forever after I moved the unsetting of timeout before the ping 
RPC.
Checked with Lars and we figured out that we can still recreate this by 
invoking the impala-shell with the SSL flag.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I130fc47f7a83f591918d6842634b4e5787d00813
Gerrit-Change-Number: 11540
Gerrit-PatchSet: 9
Gerrit-Owner: Anuj Phadke 
Gerrit-Reviewer: Anuj Phadke 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Lars Volker 
Gerrit-Reviewer: Michael Ho 
Gerrit-Reviewer: Thomas Marshall 
Gerrit-Comment-Date: Wed, 17 Oct 2018 06:40:41 +
Gerrit-HasComments: Yes


[Impala-ASF-CR] IMPALA-7555: Set socket timeout in impala-shell

2018-10-16 Thread Anuj Phadke (Code Review)
Hello Michael Ho, Thomas Marshall, Lars Volker, Impala Public Jenkins,

I'd like you to reexamine a change. Please visit

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

to look at the new patch set (#9).

Change subject: IMPALA-7555: Set socket timeout in impala-shell
..

IMPALA-7555: Set socket timeout in impala-shell

impala-shell does not set any socket timeout while connecting to the
impala server. This change sets a timeout on the socket before
connecting and unsets it back after successfully connecting. The default
timeout on this socket is 5 sec.
Usage: impala-shell --client_connect_timeout=

Testing:
1. Created a kerberized impala cluster with ssl enabled and connected
to the impalad using an openssl client (block the beeswax server thread
to accept new connection) -
E.g. - openssl s_client -connect :21000
Used impala-shell to connect to the same impalad later. impala-shell
timed out after the default of 5 sec.I verified it manually.

Change-Id: I130fc47f7a83f591918d6842634b4e5787d00813
---
M shell/impala_client.py
M shell/impala_shell.py
M shell/impala_shell_config_defaults.py
M shell/option_parser.py
M tests/shell/test_shell_commandline.py
5 files changed, 52 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/40/11540/9
--
To view, visit http://gerrit.cloudera.org:8080/11540
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I130fc47f7a83f591918d6842634b4e5787d00813
Gerrit-Change-Number: 11540
Gerrit-PatchSet: 9
Gerrit-Owner: Anuj Phadke 
Gerrit-Reviewer: Anuj Phadke 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Lars Volker 
Gerrit-Reviewer: Michael Ho 
Gerrit-Reviewer: Thomas Marshall 


[Impala-ASF-CR] IMPALA-7555: Set socket timeout in impala-shell

2018-10-16 Thread Anuj Phadke (Code Review)
Anuj Phadke has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/11540 )

Change subject: IMPALA-7555: Set socket timeout in impala-shell
..


Patch Set 8:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/11540/8/shell/impala_client.py
File shell/impala_client.py:

http://gerrit.cloudera.org:8080/#/c/11540/8/shell/impala_client.py@265
PS8, Line 265:   print_to_stderr('Connected to %s:%s' % (self.impalad_host, 
self.impalad_port))
I am moving this here. Logging this  before ping_impala_service()
should help us narrow down a hang in open() vs ping_impala_service() 
potentially.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I130fc47f7a83f591918d6842634b4e5787d00813
Gerrit-Change-Number: 11540
Gerrit-PatchSet: 8
Gerrit-Owner: Anuj Phadke 
Gerrit-Reviewer: Anuj Phadke 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Lars Volker 
Gerrit-Reviewer: Michael Ho 
Gerrit-Reviewer: Thomas Marshall 
Gerrit-Comment-Date: Tue, 16 Oct 2018 22:19:20 +
Gerrit-HasComments: Yes


[Impala-ASF-CR] IMPALA-7555: Set socket timeout in impala-shell

2018-10-16 Thread Anuj Phadke (Code Review)
Hello Michael Ho, Thomas Marshall, Lars Volker, Impala Public Jenkins,

I'd like you to reexamine a change. Please visit

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

to look at the new patch set (#8).

Change subject: IMPALA-7555: Set socket timeout in impala-shell
..

IMPALA-7555: Set socket timeout in impala-shell

impala-shell does not set any socket timeout while connecting to the
impala server. This change sets a timeout on the socket before
connecting and unsets it back after successfully connecting. The default
timeout on this socket is 5 sec.
Usage: impala-shell --client_connect_timeout=

Testing:
1. Created a kerberized impala cluster with ssl enabled and connected
to the impalad using an openssl client (block the beeswax server thread
to accept new connection) -
E.g. - openssl s_client -connect :21000
Used impala-shell to connect to the same impalad later. impala-shell
timed out after the default of 5 sec.I verified it manually.

Change-Id: I130fc47f7a83f591918d6842634b4e5787d00813
---
M shell/impala_client.py
M shell/impala_shell.py
M shell/impala_shell_config_defaults.py
M shell/option_parser.py
4 files changed, 32 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/40/11540/8
--
To view, visit http://gerrit.cloudera.org:8080/11540
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I130fc47f7a83f591918d6842634b4e5787d00813
Gerrit-Change-Number: 11540
Gerrit-PatchSet: 8
Gerrit-Owner: Anuj Phadke 
Gerrit-Reviewer: Anuj Phadke 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Lars Volker 
Gerrit-Reviewer: Michael Ho 
Gerrit-Reviewer: Thomas Marshall 


[Impala-ASF-CR] IMPALA-7555: Set socket timeout in impala-shell

2018-10-15 Thread Anuj Phadke (Code Review)
Anuj Phadke has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/11540 )

Change subject: IMPALA-7555: Set socket timeout in impala-shell
..


Patch Set 7:

I added some debugging logging to narrow down the failure. The open() in 
connect seems to finish very quickly in milliseconds. Majority of the time 
seems to contributed by PingImpalaService()

E   AssertionError: Cmd --query="create table
test_kudu_dml_reporting_256dcf63.dml_test (id int primary key, age int null) 
partition by hash(id) partitions 2 stored as kudu" was expected to succeed: 
Starting Impala Shell without Kerberos authentication
E   time taken to  connect in open(): 0.000133037567139
E   time with socket error: 5.005163908

I removed the handling of exception in the code and the socket timeout 
exception was thrown in the PingImpala() function -
Stacktrace

/data/jenkins/workspace/impala-private-parameterized/repos/Impala/tests/shell/test_shell_commandline.py:137:
 in test_default_db
result = run_impala_shell_cmd(args)
shell/util.py:97: in run_impala_shell_cmd
result.stderr)
E   AssertionError: Cmd -d parquet was expected to succeed: Starting Impala 
Shell without Kerberos authentication
E   Traceback (most recent call last):
E File 
"/data/jenkins/workspace/impala-private-parameterized/repos/Impala/shell/impala_shell.py",
 line 1720, in 
E   shell = ImpalaShell(options, query_options)
E File 
"/data/jenkins/workspace/impala-private-parameterized/repos/Impala/shell/impala_shell.py",
 line 233, in __init__
E   self.do_connect(options.impalad)
E File 
"/data/jenkins/workspace/impala-private-parameterized/repos/Impala/shell/impala_shell.py",
 line 799, in do_connect
E   self._connect()
E File 
"/data/jenkins/workspace/impala-private-parameterized/repos/Impala/shell/impala_shell.py",
 line 844, in _connect
E   result = self.imp_client.connect()
E File 
"/data0/jenkins/workspace/impala-private-parameterized/repos/Impala/shell/impala_client.py",
 line 260, in connect
E   result = self.ping_impala_service()
E File 
"/data0/jenkins/workspace/impala-private-parameterized/repos/Impala/shell/impala_client.py",
 line 267, in ping_impala_service
E   return self.imp_service.PingImpalaService()
E File 
"/data/jenkins/workspace/impala-private-parameterized/repos/Impala/shell/gen-py/ImpalaService/ImpalaService.py",
 line 229, in PingImpalaService
E   return self.recv_PingImpalaService()
E File 
"/data/jenkins/workspace/impala-private-parameterized/repos/Impala/shell/gen-py/ImpalaService/ImpalaService.py",
 line 240, in recv_PingImpalaService
E   (fname, mtype, rseqid) = iprot.readMessageBegin()
E File 
"/data/jenkins/workspace/impala-private-parameterized/Impala-Toolchain/thrift-0.9.3-p4/python/lib64/python2.7/site-packages/thrift/protocol/TBinaryProtocol.py",
 line 126, in readMessageBegin
E   sz = self.readI32()
E File 
"/data/jenkins/workspace/impala-private-parameterized/Impala-Toolchain/thrift-0.9.3-p4/python/lib64/python2.7/site-packages/thrift/protocol/TBinaryProtocol.py",
 line 206, in readI32
E   buff = self.trans.readAll(4)
E File 
"/data/jenkins/workspace/impala-private-parameterized/Impala-Toolchain/thrift-0.9.3-p4/python/lib64/python2.7/site-packages/thrift/transport/TTransport.py",
 line 58, in readAll
E   chunk = self.read(sz - have)
E File 
"/data/jenkins/workspace/impala-private-parameterized/Impala-Toolchain/thrift-0.9.3-p4/python/lib64/python2.7/site-packages/thrift/transport/TTransport.py",
 line 159, in read
E   self.__rbuf = StringIO(self.__trans.read(max(sz, self.__rbuf_size)))
E File 
"/data/jenkins/workspace/impala-private-parameterized/Impala-Toolchain/thrift-0.9.3-p4/python/lib64/python2.7/site-packages/thrift/transport/TSocket.py",
 line 105, in read
E   buff = self.handle.recv(sz)
E   socket.timeout: timed out

I think the fix would be to move the timeout before the PingImpalaService.
Might have to get rid of the test I added as it will connect and the timeout 
happens in the PingRPC call.
I will verify it once on a kerberized setup.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I130fc47f7a83f591918d6842634b4e5787d00813
Gerrit-Change-Number: 11540
Gerrit-PatchSet: 7
Gerrit-Owner: Anuj Phadke 
Gerrit-Reviewer: Anuj Phadke 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Lars Volker 
Gerrit-Reviewer: Michael Ho 
Gerrit-Reviewer: Thomas Marshall 
Gerrit-Comment-Date: Mon, 15 Oct 2018 07:35:05 +
Gerrit-HasComments: No


[Impala-ASF-CR] IMPALA-7555: Set socket timeout in impala-shell

2018-10-10 Thread Anuj Phadke (Code Review)
Anuj Phadke has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/11540 )

Change subject: IMPALA-7555: Set socket timeout in impala-shell
..


Patch Set 6:

(5 comments)

http://gerrit.cloudera.org:8080/#/c/11540/5/shell/impala_client.py
File shell/impala_client.py:

http://gerrit.cloudera.org:8080/#/c/11540/5/shell/impala_client.py@81
PS5, Line 81: self.fetch_batch_size = 1024
> nit: move below use_ldap to follow order or arguments
Done


http://gerrit.cloudera.org:8080/#/c/11540/5/shell/impala_client.py@255
PS5, Line 255: if self.client_connect_timeout_ms > 0:
> This comment can be moved to above line 264.
Done


http://gerrit.cloudera.org:8080/#/c/11540/5/shell/impala_client.py@258
PS5, Line 258: protocol = TBinaryProtocol.TBinaryProtocol(self.transport)
 : self.imp_service = Impa
> Given sock is just returned from self._get_socket_and_transport(), I don't
Done


http://gerrit.cloudera.org:8080/#/c/11540/5/shell/option_parser.py
File shell/option_parser.py:

http://gerrit.cloudera.org:8080/#/c/11540/5/shell/option_parser.py@224
PS5, Line 224:   parser.add_option("-t", "--client_connect_timeout_ms",
> nit: no newline, follow surrounding code
Done


http://gerrit.cloudera.org:8080/#/c/11540/5/shell/option_parser.py@227
PS5, Line 227: " timeout.")
> Set to 0 to disable any timeout.
Done



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I130fc47f7a83f591918d6842634b4e5787d00813
Gerrit-Change-Number: 11540
Gerrit-PatchSet: 6
Gerrit-Owner: Anuj Phadke 
Gerrit-Reviewer: Anuj Phadke 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Lars Volker 
Gerrit-Reviewer: Michael Ho 
Gerrit-Reviewer: Thomas Marshall 
Gerrit-Comment-Date: Wed, 10 Oct 2018 20:27:08 +
Gerrit-HasComments: Yes


[Impala-ASF-CR] IMPALA-7555: Set socket timeout in impala-shell

2018-10-10 Thread Anuj Phadke (Code Review)
Hello Michael Ho, Thomas Marshall, Lars Volker, Impala Public Jenkins,

I'd like you to reexamine a change. Please visit

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

to look at the new patch set (#6).

Change subject: IMPALA-7555: Set socket timeout in impala-shell
..

IMPALA-7555: Set socket timeout in impala-shell

impala-shell does not set any socket timeout while connecting to the
impala server. This change sets a timeout on the socket before
connecting and unsets it back after successfully connecting. The default
timeout on this socket is 1 min.
Usage: impala-shell --client_connect_timeout=

Testing:
1. Added a test where I create a random listening socket.
impala-shell connects to this socket and times out after the default
timeout value.
2. Created a kerberized impala cluster with ssl enabled and connected
to the impalad using an openssl client (block the beeswax server thread
to accept new connection) -
E.g. - openssl s_client -connect :21000
Used impala-shell to connect to the same impalad later. impala-shell
timed out after the default of 1 min.I verified it manually.

Change-Id: I130fc47f7a83f591918d6842634b4e5787d00813
---
M shell/impala_client.py
M shell/impala_shell.py
M shell/impala_shell_config_defaults.py
M shell/option_parser.py
M tests/shell/test_shell_commandline.py
5 files changed, 40 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/40/11540/6
--
To view, visit http://gerrit.cloudera.org:8080/11540
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I130fc47f7a83f591918d6842634b4e5787d00813
Gerrit-Change-Number: 11540
Gerrit-PatchSet: 6
Gerrit-Owner: Anuj Phadke 
Gerrit-Reviewer: Anuj Phadke 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Lars Volker 
Gerrit-Reviewer: Michael Ho 
Gerrit-Reviewer: Thomas Marshall 


[Impala-ASF-CR] [WIP] IMPALA-7555: Set socket timeout in impala-shell

2018-10-03 Thread Anuj Phadke (Code Review)
Anuj Phadke has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/11540 )

Change subject: [WIP] IMPALA-7555: Set socket timeout in impala-shell
..


Patch Set 5:

(6 comments)

http://gerrit.cloudera.org:8080/#/c/11540/1/shell/impala_client.py
File shell/impala_client.py:

http://gerrit.cloudera.org:8080/#/c/11540/1/shell/impala_client.py@261
PS1, Line 261: protocol = TBinaryProtocol.TBinaryProtocol(self.transport)
> This explains why: https://docs.python.org/2/library/socket.html#socket.soc
Done


http://gerrit.cloudera.org:8080/#/c/11540/4/shell/impala_client.py
File shell/impala_client.py:

http://gerrit.cloudera.org:8080/#/c/11540/4/shell/impala_client.py@280
PS4, Line 280:the kerberized version, a sasl transport is created.
> Please keep the order consistent between the name, the comment, and the ret
Done


http://gerrit.cloudera.org:8080/#/c/11540/1/shell/impala_shell_config_defaults.py
File shell/impala_shell_config_defaults.py:

http://gerrit.cloudera.org:8080/#/c/11540/1/shell/impala_shell_config_defaults.py@54
PS1, Line 54: 'client_connect_timeout_ms': 5000,
> Some stress testing in a larger cluster under load would be good. See the c
Will try that.


http://gerrit.cloudera.org:8080/#/c/11540/3/shell/option_parser.py
File shell/option_parser.py:

http://gerrit.cloudera.org:8080/#/c/11540/3/shell/option_parser.py@225
PS3, Line 225: "-t", "--client_connect_timeout_ms"
> That's also a fine option. It seems the current behavior with 0 is not well
anuj@anuj-OptiPlex-9020:~/Impala$
anuj@anuj-OptiPlex-9020:~/Impala$ ./bin/impala-shell.sh -i 
anuj-timeout-3.gce.cloudera.com:21000 --ssl -q "show tables"
Starting Impala Shell without Kerberos authentication
SSL is enabled. Impala server certificates will NOT be verified (set --ca_cert 
to change)
Error connecting: TTransportException, Could not connect to 
anuj-timeout-3.gce.cloudera.com:21000: _ssl.c:495: The handshake operation 
timed out
Not connected to Impala, could not execute queries.


--Without timeout set to 0 it was stuck.
anuj@anuj-OptiPlex-9020:~/Impala$ ./bin/impala-shell.sh -i 
anuj-timeout-3.gce.cloudera.com:21000 --ssl -q "show tables" -t 0
Starting Impala Shell without Kerberos authentication
SSL is enabled. Impala server certificates will NOT be verified (set --ca_cert 
to change)


http://gerrit.cloudera.org:8080/#/c/11540/4/shell/option_parser.py
File shell/option_parser.py:

http://gerrit.cloudera.org:8080/#/c/11540/4/shell/option_parser.py@227
PS4, Line 227: connect
> connect to Impala server.
Done


http://gerrit.cloudera.org:8080/#/c/11540/4/tests/shell/test_shell_commandline.py
File tests/shell/test_shell_commandline.py:

http://gerrit.cloudera.org:8080/#/c/11540/4/tests/shell/test_shell_commandline.py@749
PS4, Line 749: '-q "select foo; select bar;" -t 2000 -i localhost:%d' % 
(test_port)
> nit: no need for '+':
Done



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I130fc47f7a83f591918d6842634b4e5787d00813
Gerrit-Change-Number: 11540
Gerrit-PatchSet: 5
Gerrit-Owner: Anuj Phadke 
Gerrit-Reviewer: Anuj Phadke 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Lars Volker 
Gerrit-Reviewer: Michael Ho 
Gerrit-Reviewer: Thomas Marshall 
Gerrit-Comment-Date: Wed, 03 Oct 2018 23:46:20 +
Gerrit-HasComments: Yes


[Impala-ASF-CR] [WIP] IMPALA-7555: Set socket timeout in impala-shell

2018-10-03 Thread Anuj Phadke (Code Review)
Hello Michael Ho, Thomas Marshall, Lars Volker, Impala Public Jenkins,

I'd like you to reexamine a change. Please visit

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

to look at the new patch set (#5).

Change subject: [WIP] IMPALA-7555: Set socket timeout in impala-shell
..

[WIP] IMPALA-7555: Set socket timeout in impala-shell

impala-shell does not set any socket timeout while connecting to the
impala server. This change sets a timeout on the socket before
connecting and unsets it back after successfully connecting. The default
timeout on this socket is 1 min.
Usage: impala-shell --client_connect_timeout=

Testing:
1. Added a test where I create a random listening socket.
impala-shell connects to this socket and times out after the default
timeout value.
2. Created a kerberized impala cluster with ssl enabled and connected
to the impalad using an openssl client (block the beeswax server thread
to accept new connection) -
E.g. - openssl s_client -connect :21000
Used impala-shell to connect to the same impalad later. impala-shell
timed out after the default of 1 min.I verified it manually.

Change-Id: I130fc47f7a83f591918d6842634b4e5787d00813
---
M shell/impala_client.py
M shell/impala_shell.py
M shell/impala_shell_config_defaults.py
M shell/option_parser.py
M tests/shell/test_shell_commandline.py
5 files changed, 41 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/40/11540/5
--
To view, visit http://gerrit.cloudera.org:8080/11540
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I130fc47f7a83f591918d6842634b4e5787d00813
Gerrit-Change-Number: 11540
Gerrit-PatchSet: 5
Gerrit-Owner: Anuj Phadke 
Gerrit-Reviewer: Anuj Phadke 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Lars Volker 
Gerrit-Reviewer: Michael Ho 
Gerrit-Reviewer: Thomas Marshall 


[Impala-ASF-CR] [WIP] IMPALA-7555: Set socket timeout in impala-shell

2018-10-02 Thread Anuj Phadke (Code Review)
Anuj Phadke has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/11540 )

Change subject: [WIP] IMPALA-7555: Set socket timeout in impala-shell
..


Patch Set 4:

(6 comments)

http://gerrit.cloudera.org:8080/#/c/11540/3/shell/impala_client.py
File shell/impala_client.py:

http://gerrit.cloudera.org:8080/#/c/11540/3/shell/impala_client.py@81
PS3, Line 81: int(client_connect_timeout_ms)
> Any idea what happens if the user passes a negative value ? Also, it seems
Nope it does not work.
./bin/impala-shell.sh -i localhost:1234 -t -1 -q "show tables"
Starting Impala Shell without Kerberos authentication
Error connecting: ValueError, Timeout value out of range
Not connected to Impala, could not execute queries.
anuj@anuj-OptiPlex-9020:~/Impala$

setTimeout converts it to float by dividing the ms by 1000.0
I am ok with converting it to int here and it getting implicitly typecasted to 
a float


http://gerrit.cloudera.org:8080/#/c/11540/3/shell/impala_shell.py
File shell/impala_shell.py:

http://gerrit.cloudera.org:8080/#/c/11540/3/shell/impala_shell.py@a864
PS3, Line 864:
> Why was this removed ?
Moved it back.


http://gerrit.cloudera.org:8080/#/c/11540/3/shell/option_parser.py
File shell/option_parser.py:

http://gerrit.cloudera.org:8080/#/c/11540/3/shell/option_parser.py@225
PS3, Line 225: "-t", "--client_connect_timeout_ms"
> Do you think it makes sense to have a value (e.g. 0) which allows user to d
I tried setting it here
1.
 anuj@anuj-OptiPlex-9020:~/Impala$ time ./bin/impala-shell.sh -i localhost:1234 
-t 0 -q "show tables"
Starting Impala Shell without Kerberos authentication
Error connecting: TTransportException, Could not connect to localhost:1234
Not connected to Impala, could not execute queries.

real0m0.121s
user0m0.084s
sys 0m0.028s
anuj@anuj-OptiPlex-9020:~/Impala$

2.
I tried reverting it back to 0 (in connect())  and that resulted in some of the 
tests failing.


http://gerrit.cloudera.org:8080/#/c/11540/3/shell/option_parser.py@227
PS3, Line 227:  i
> nit: missing space before "if"
Done


http://gerrit.cloudera.org:8080/#/c/11540/3/tests/shell/test_shell_commandline.py
File tests/shell/test_shell_commandline.py:

http://gerrit.cloudera.org:8080/#/c/11540/3/tests/shell/test_shell_commandline.py@740
PS3, Line 740:
> nit: extra whitespace
Done


http://gerrit.cloudera.org:8080/#/c/11540/3/tests/shell/test_shell_commandline.py@742
PS3, Line 742: indefinitely
> indefinitely ?
Done



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I130fc47f7a83f591918d6842634b4e5787d00813
Gerrit-Change-Number: 11540
Gerrit-PatchSet: 4
Gerrit-Owner: Anuj Phadke 
Gerrit-Reviewer: Anuj Phadke 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Lars Volker 
Gerrit-Reviewer: Michael Ho 
Gerrit-Reviewer: Thomas Marshall 
Gerrit-Comment-Date: Tue, 02 Oct 2018 20:50:40 +
Gerrit-HasComments: Yes


[Impala-ASF-CR] [WIP] IMPALA-7555: Set socket timeout in impala-shell

2018-10-02 Thread Anuj Phadke (Code Review)
Hello Michael Ho, Thomas Marshall, Lars Volker, Impala Public Jenkins,

I'd like you to reexamine a change. Please visit

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

to look at the new patch set (#4).

Change subject: [WIP] IMPALA-7555: Set socket timeout in impala-shell
..

[WIP] IMPALA-7555: Set socket timeout in impala-shell

impala-shell does not set any socket timeout while connecting to the
impala server. This change sets a timeout on the socket before
connecting and unsets it back after successfully connecting. The default
timeout on this socket is 1 min.
Usage: impala-shell --client_connect_timeout=

Testing:
1. Added a test where I create a random listening socket.
impala-shell connects to this socket and times out after the default
timeout value.
2. Created a kerberized impala cluster with ssl enabled and connected
to the impalad using an openssl client (block the beeswax server thread
to accept new connection) -
E.g. - openssl s_client -connect :21000
Used impala-shell to connect to the same impalad later. impala-shell
timed out after the default of 1 min.I verified it manually.

Change-Id: I130fc47f7a83f591918d6842634b4e5787d00813
---
M shell/impala_client.py
M shell/impala_shell.py
M shell/impala_shell_config_defaults.py
M shell/option_parser.py
M tests/shell/test_shell_commandline.py
5 files changed, 37 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/40/11540/4
--
To view, visit http://gerrit.cloudera.org:8080/11540
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I130fc47f7a83f591918d6842634b4e5787d00813
Gerrit-Change-Number: 11540
Gerrit-PatchSet: 4
Gerrit-Owner: Anuj Phadke 
Gerrit-Reviewer: Anuj Phadke 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Lars Volker 
Gerrit-Reviewer: Michael Ho 
Gerrit-Reviewer: Thomas Marshall