Hive Client is indefenitely waiting for reading from Socket -----------------------------------------------------------
Key: HIVE-2110 URL: https://issues.apache.org/jira/browse/HIVE-2110 Project: Hive Issue Type: Bug Components: JDBC Affects Versions: 0.5.0 Environment: Hadoop 0.20.1, Hive0.5.0 and SUSE Linux Enterprise Server 10 SP2 (i586) - Kernel 2.6.16.60-0.21-smp (5). Reporter: Chinna Rao Lalam Hive Client is indefenitely waiting for reading from Socket. Thread dump i added below. Cause is: In the HiveClient, when client socket is created, the read timeout is mentioned is 0. So the socket will indefinetly wait when the machine where Hive Server is running is "shutdown" or "network is unplugged". The same may not happen if the HiveServer alone is killed or gracefully shutdown. At this time, client will get "connection reset exception". Code in HiveConnection ----------------------------------- {noformat} transport = new TSocket(host, port); TProtocol protocol = new TBinaryProtocol(transport); client = new HiveClient(protocol); {noformat} In the Client side, they send the query and wait for the response send_execute(query,id); recv_execute(); // place where client waiting is initiated Thread dump: {noformat} "main" prio=10 tid=0x0000000040111000 nid=0x3641 runnable [0x00007f0d73f29000] java.lang.Thread.State: RUNNABLE at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:129) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read1(BufferedInputStream.java:258) at java.io.BufferedInputStream.read(BufferedInputStream.java:317) locked <0x00007f0d5d3f0828> (a java.io.BufferedInputStream) at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:125) at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84) at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:314) at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:262) at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:192) at org.apache.hadoop.hive.service.ThriftHive$Client.recv_execute(ThriftHive.java:130) at org.apache.hadoop.hive.service.ThriftHive$Client.execute(ThriftHive.java:109) locked <0x00007f0d5d3f0878> (a org.apache.thrift.transport.TSocket) at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:218) at org.apache.hadoop.hive.jdbc.HiveStatement.execute(HiveStatement.java:154) {noformat} -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira