Skip to content

HIVE-29048: Increase default pool and queue size of HS2 Background Async Threadpool. #5904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mdayakar
Copy link
Contributor

HIVE-29048: Increase default pool and queue size of HS2 Background Async Threadpool.

What changes were proposed in this pull request?

To increase the default value for the hive.server2.async.exec.threads and hive.server2.async.exec.wait.queue.size configuration from 100 to 250.

Recently most of the customers reported below error on beeline

0: jdbc:hive2://localhost> show databases;
Error: The background threadpool cannot accept new task for execution, please retry the operation (state=,code=0)

HS2 server logs shows below exception

Caused by: java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@24363395 rejected from java.util.concurrent.ThreadPoolExecutor@54ef7045[Running, pool size = 100, active threads = 100, queued tasks = 100, completed tasks = 682504]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2063) ~[?:1.8.0_342]
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830) ~[?:1.8.0_342]
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1379) ~[?:1.8.0_342]
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112) ~[?:1.8.0_342]
at org.apache.hive.service.cli.session.SessionManager.submitBackgroundOperation(SessionManager.java:760) ~[hive-service-3.1.3]
at org.apache.hive.service.cli.session.HiveSessionImpl.submitBackgroundOperation(HiveSessionImpl.java:598) ~[hive-service-3.1.3]
at org.apache.hive.service.cli.operation.SQLOperation.runInternal(SQLOperation.java:279) ~[hive-service-3.1.3]
... 50 more

So here for most of the customers load, the default value 100 is not sufficient so their queries are getting rejected.

Why are the changes needed?

The changes required to handle most of the customer's cluster basic load.

Does this PR introduce any user-facing change?

No

How was this patch tested?

NA

@deniskuzZ
Copy link
Member

deniskuzZ commented Jun 26, 2025

@mdayakar, these configs remain unchanged since Hive 2.3. Typically, customers can override them by modifying hive-site.xml
downstream we use hive-site.xml template with the following values, but it’s not a one-size-fits-all solution

hive.server2.async.exec.threads=200
hive.server2.async.exec.wait.queue.size=1000

Copy link

@mdayakar
Copy link
Contributor Author

@mdayakar, these configs remain unchanged since Hive 2.3. Typically, customers can override them by modifying hive-site.xml downstream we use hive-site.xml template with the following values, but it’s not a one-size-fits-all solution

hive.server2.async.exec.threads=200
hive.server2.async.exec.wait.queue.size=1000

Hi @deniskuzZ ,
I agree that users can modify the value in hive-site.xml or they can set through via beeline also but if they are not configuring it in hive-site.xml then the default value 100 will be considered and for most of the customer's workload this value is not sufficient. So I proposed to increase this value to 250. Anyway if there is no load on the cluster these threads will be terminated based on keepalive timeout(10s) so even if the default value is 250 there will not be any issue. This is mainly for those customers who uses the default value configured in HiveConf.java file and faces the RejectedException due to 100 default value.

@deniskuzZ
Copy link
Member

Hi @deniskuzZ , I agree that users can modify the value in hive-site.xml or they can set through via beeline also but if they are not configuring it in hive-site.xml then the default value 100 will be considered and for most of the customer's workload this value is not sufficient. So I proposed to increase this value to 250. Anyway if there is no load on the cluster these threads will be terminated based on keepalive timeout(10s) so even if the default value is 250 there will not be any issue. This is mainly for those customers who uses the default value configured in HiveConf.java file and faces the RejectedException due to 100 default value.

Cluster administrator should manage the configs. None of production setups should rely on default values. Note, I don't have strong opinions about this change

+0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants