Decent work! The use of threads is also messy in the iotdb-cluster module. We can continue to optimize based on this pr.
However, this requires code submitters and reviewers to ensure do not use `Executors.newXXX()` FUNCTIONS ANY MORE IN THE FUTURE. It would be better if a code detection tool could do this, and I think this rule can be added to the PR template, so that the PR submitter can see this rule through self inspection. Thanks, --------------------------------------- Houliang Qi BONC, Ltd On 08/11/2021 00:37,Xiangdong Huang<saint...@gmail.com> wrote: Hi, We use many thread pools in IoTDB and it is hard to know how many thread pool we have totally and whether a thread pool is busy. Therefore, I unify the creation of ThreadPool, register it to JMX and allow JMX to check its active size, pending size, etc.. When the threadpool is `shutdown()` or `shutdownNow()`, the Pool will be deregistered from JMX. Only The server module has been upgrade to such kind of ThreadPool in rel/0.12 branch. NOTICE, Once this PR is merged, in the server module, DO NOT USE `Executors.newXXX()` FUNCTIONS ANY MORE IN THE FUTURE. For all committers, PLEASE avoid codes like `Executors.newXXX()` when you review PRs in the future. I will do the same thing in the Master branch and replace all thread pools in the cluster module using this kind of thread pool. see PR [1]. [1] https://github.com/apache/iotdb/pull/3717 Best, ----------------------------------- Xiangdong Huang School of Software, Tsinghua University 黄向东 清华大学 软件学院