Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Expired sessions not closed in Impala

avatar
Explorer

I have the idle_session_timeout set to some value. Once the threshold is crossed, the session is marked as expired in the web UI. But however the sessions do not seem to get closed.

 

Even after clicking on the close button across each expired session, a notification is shown that the session has been closed successfully. However a netstat on the daemon shows that the connection is still established. Only when the session is disconnected from the client, the connection is closed in impala daemon. 

 

I see threads running back in 2015 mentioning this issue. But I do not see any foormal closure as such. Has this issue been fixed. If so in which version is it available. 

6 REPLIES 6

avatar
Cloudera Employee

How are you connecting to Impala?  Generally, a connection supports multiple sessions.  A session closing wouldn't imply that the connection would be closed given that the connection can have other sessions.  Session close will free the state associated with that session and close any operations/requests that were made in that session that are still open. 

avatar
Explorer

I am connecting to impala through the jdbc/odbc drivers.

 

Lets say there is a jdbc conenction established from a sql client. If the sql client is not closed, then a connection is always established from the particular application to the deamon without any active session(s).

1. Is there a way to time-out such inactive connections(as in without any active sessions).
2. Would these connection actually consume/hold resources leading to considerable resource crunches when there are more number of inactive connections. If so, is there a way to release them?.

avatar
Cloudera Employee

avatar
New Contributor

Thanks for the suggestion. That is the feature i am looking for. However despite using it, I am not able realise the functionality of SocketTimeOut.

 

I use the following url : jdbc:impala://<host>:21050//<default>;SocketTimeout=1000;AuthMech=3;UID=<user>;PWD=<password>;

 

The connection is successful but the connection does not get closed at all post the time out. When i do a netstat, the connection is established ever. Let me know if i am missing out on something here.

 

Impala version : Impalad version 2.11.0-cdh5.14.0 RELEASE
Driver : Cloudera_ImpalaJDBC4_2.5.5.1007.

 

I believe(not sure though) that the client is able to pass the SocketTimeOut parameter but the server is unable to timeout the connection once the threshold is reached.

 

Note : I get the following output in the console :
Connection messages:
[Simba][ImpalaJDBCDriver](100001) Error setting default connection property values.

 

avatar
Contributor

SocketTimeout sets a socket timeout in the network layer. For any API call which is made the network waits for a response from the server and if the response is not received in the specified limit, socket times out. It is also applicable during connection.

As of now, there is nothing in the driver which can close the connection if it is idle for a certain amount of time.

 

I'd also mention there are much newer versions of the driver than v2.5.5.  Latest is v.2.5.43.

https://www.cloudera.com/downloads/connectors/impala/jdbc.html

 

avatar
New Contributor

I have no idea about your actual code.

If you are using a Jdbc connector, it is better to use the 'Hikari Datasource'. 

ref) https://devrish.wordpress.com/2019/11/24/impala-database-connection-using-hikari-pool-in-springboot/

 

And you can use 'close()' method on code that is methods of a Hikari datasource object.

It shutdown all of network connection between your server and impala daemon.