Skip to main content
Hail2Ichi
Silver ⭐️
June 14, 2019
Solved

Impala query that is "Executing" but query status is "Finished"

Hello.

 

We're on version CDH 5.12.2.

On Cloudera Manager, Impala -> Query , I see query that is "Executing" but query status is "Finished".

query_duration was 42/51 mins.

 

User is running query on Hue.

 

I've searched through official papers, google it, but getting nowhere.

Did user left Hue before getting query result?

 

Can anyone give me explanation on this?

 

Thank you!

 

lwang
lwangAnswer
Platinum ⭐️
June 19, 2019

Hi @Hail2Ichi ,

 

Hue does not close the connection to Impala until the results page is clicked on. Clicking the results page in Hue executes the fetchresults call to Impala.

 

Since Impala queries are client driven ( for example, until client calls fetch to complete fetching entire result set), the query still remains in a running state. And when a query has not been closed/unregistered, Impala shows it in the In Flight section in its web UI. Cloudera Manager shows all In Flight queries as Executing.

 

To mitigate this problem, we need to ask Impala to kill any idle sessions if not used, so that resources will be released. In order to do this, we need to set the timeout value for the idle sessions. When a session ends, all its sessions are closed. Follow below steps:

 

  1. From Cloudera Manager UI, navigate to Impala > Configuration > Service-Wide > Advanced > Impala Command Line Argument Advanced Configuration Snippet (Safety Valve).
  2. Set session timeout parameter (value is in seconds). 

    --idle_session_timeout=<the maximum lifetime of your queries>

Note: How long to timeout the session will depend on end users' usage. Ideally to be at least 1-2 hours so that Hue user does not have to keep refreshing the Impala Editor page. Example: 

--idle_session_timeout=3600

We also document above in more detail in below knowledge article:

Finished Queries show as Executing in the Cloudera Manager Impala Queries Page:

https://my.cloudera.com/knowledge/Finished-Queries-show-as-Executing-in-the-Cloudera-Manager?id=71576

 

Thanks and hope this helps,

Li

Li Wang, Technical Solution Manager

4 replies

manuroman
Gold ⭐️
June 18, 2019

Hi @Hail2Ichi,

 

Try to update Impala JDBC Connector.

 

Regards, 

Manu.

Translate
lwang
Platinum ⭐️
lwangAnswer
Platinum ⭐️
June 19, 2019

Hi @Hail2Ichi ,

 

Hue does not close the connection to Impala until the results page is clicked on. Clicking the results page in Hue executes the fetchresults call to Impala.

 

Since Impala queries are client driven ( for example, until client calls fetch to complete fetching entire result set), the query still remains in a running state. And when a query has not been closed/unregistered, Impala shows it in the In Flight section in its web UI. Cloudera Manager shows all In Flight queries as Executing.

 

To mitigate this problem, we need to ask Impala to kill any idle sessions if not used, so that resources will be released. In order to do this, we need to set the timeout value for the idle sessions. When a session ends, all its sessions are closed. Follow below steps:

 

  1. From Cloudera Manager UI, navigate to Impala > Configuration > Service-Wide > Advanced > Impala Command Line Argument Advanced Configuration Snippet (Safety Valve).
  2. Set session timeout parameter (value is in seconds). 

    --idle_session_timeout=<the maximum lifetime of your queries>

Note: How long to timeout the session will depend on end users' usage. Ideally to be at least 1-2 hours so that Hue user does not have to keep refreshing the Impala Editor page. Example: 

--idle_session_timeout=3600

We also document above in more detail in below knowledge article:

Finished Queries show as Executing in the Cloudera Manager Impala Queries Page:

https://my.cloudera.com/knowledge/Finished-Queries-show-as-Executing-in-the-Cloudera-Manager?id=71576

 

Thanks and hope this helps,

Li

Translate
Li Wang, Technical Solution Manager
Hail2Ichi
Hail2IchiAuthor
Silver ⭐️
June 19, 2019

Thank you!

We're planning to move from Hue now.

 

 

Translate