-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[Bug] Connection hang after too high qps #31569
Labels
Comments
I want to try it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Search before asking
Version
master & 2.0
What's Wrong?
If current running connections bigger than
max_mysql_service_task_threads_num
, new connection will hang.The problem is:
AcceptListener.java ==> handleEvent ==>
channel.getWorker().execute
got rejectedExecution, but do not throw it.We should:
mysql-nio-pool
to useThreadPoolManager.newDaemonCacheThreadPoolThrowException
, make sure when connection rejected, throwRejectedExecutionException
;RejectedExecutionException
inside AcceptListener.java::handleEvent, close the connection with a error message;What You Expected?
return error instead of hang
How to Reproduce?
max_mysql_service_task_threads_num=2
in fe.conf;mysql -hxxx -e 'select sleep(300);'
;mysql -hxxx -e 'select 1;'
;In the log we found, the third sql already been rejected, and will not be executed anymore, the third connection hanged.
2024-02-29 11:55:49,299 WARN (doris-mysql-nio I/O-2|193) [ThreadPoolManager$LogDiscardPolicy.rejectedExecution():305] Task org.apache.doris.mysql.AcceptListener$$Lambda$1918/502547814@1a81657b rejected from mysql-nio-pool java.util.concurrent.ThreadPoolExecutor@59bfd0bf[Running, pool size = 2, active threads = 2, queued tasks = 0, completed tasks = 24]
Anything Else?
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: