Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

JDBC driver socket timeout is not working

JDBC driver socket timeout is not working

Explorer

Hi,

 

Had come across SocketTimeout option in jdbc driver and tried it out to see if helps in taking care of idle connections. It is not working as expected, even default value is not working. I am using ImpalaJDBC_2.5.24.1043 version (free) and using CDH 5.7.0.

 

Is anyone else using SocketTimeout option comes across this issue?

 

The reason for looking out this option is, had come across a situation, wherein client program waiting for so long to get the connection from impala, almost close to 2 hrs. No exception in logs, client etc but it keeps on waiting. During this moment, total front end connections in use didn't even reached 50% of the total front end connections (from cloudera manager graph). Restarting impalad's helped to recover this situation.

 

Hence, thought of exploring some connection timeout option as an attempt to see whether control comes out as soon as it reaches max threshold time while fetching the connections, instead of waiting indefinitely. While doing this, come across above socket timeout option and tried out as it was also an another requirement for me to clear idle connections.

 

Thanks,

Mani

2 REPLIES 2

Re: JDBC driver socket timeout is not working

Champion
Have you looked at the idle query timeout setting in Impala itself? There is the session level equivalent of QUERY_TIMEOUT_S that you can try from within your JDBC connection.

https://www.cloudera.com/documentation/enterprise/5-7-x/topics/impala_timeouts.html
Highlighted

Re: JDBC driver socket timeout is not working

Explorer

I've explored idle query timeout and idle session out before itself and using in prod cluster as well. Those timeouts are not related to idle connections. Idle session timeout is taking care of only session, but still connection is established and being counted under active connections in use. On reading about SocketTimeout option in jdbc driver, it clearly said it will take care of idle connections. Hence tried it out, but doesn't seem to work. Most of users here, using sql workbench through jdbc driver keeps opening new tab for every new query and don't close their tab for the whole day. I assumed sockettimeout will solve this problem.