You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Chinna <ch...@huawei.com> on 2011/04/01 07:23:57 UTC

Hive Client is indefenitely waiting for reading from Socket

Hi All,

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
----------------------------------- 
transport = new TSocket(host, port);
TProtocol protocol = new TBinaryProtocol(transport);
client = new HiveClient(protocol);

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

Here we cannot give a time out for socket also, because Query may execute
for long time. The query execution time cannot be predetermined. 

Any suggestions for fixing this issue.

Thread dump:

"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.jav
a: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:21
8)
	at
org.apache.hadoop.hive.jdbc.HiveStatement.execute(HiveStatement.java:154)
	at com.huawei.isap.i3.HiveJdbcClient.main(HiveJdbcClient.java:114)


Thanks&Regards,
Chinna Rao Lalam