HiveServer is unresponsive due to large queries running in parallel

Condition

HiveServer (HS2) is blocking user queries or sessions because of multiple Hive sessions running in parallel.

Cause

The issue occurs when a large query is running and you submit the same query again. The hive.query.results.cache.wait.for.pending.results property forces a query to wait for the pending results of an already running query, in order to use the cached result when it is ready.

You can choose to disable this property to avoid blocking queries submitted by other users or you can avoid running the same large queries parallely.

Remedy

  1. Go to Clusters > Hive on Tez > Configuration and add the following property name and its value in the HiveServer2 Advanced Configuration Snippet (Safety Valve) for hive-site.xml field:

    Name: hive.query.results.cache.wait.for.pending.results

    Value: false

  2. Save the changes and restart the Hive on Tez service.