This is an automated email from the ASF dual-hosted git repository. JackieTien97 pushed a commit to branch ty/server-thread-pool-guidance in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit e6314a9242e584e75c123704d2dec6910ee39da6 Author: JackieTien97 <[email protected]> AuthorDate: Sun Nov 22 10:17:47 2026 +0800 Document server thread pool conventions in AGENTS.md (cherry picked from commit d4fa00cbf7207b30d5f31118222f2839b347ece0) --- AGENTS.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 252cf536852..26925b741df 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -140,6 +140,19 @@ the corresponding module file; link to existing guidance instead of copying it. - **Checkstyle** is also configured (see `checkstyle.xml` at project root). - Java source/target level is 17 (compiled with `maven.compiler.release=17` on JDK 17+). +### Java server thread pools + +- In server modules that use `node-commons`, create new production pools with + `IoTDBThreadPoolFactory`. When the owner needs direct executor operations such as + `remove(Runnable)`, use `WrappedThreadPoolExecutor`. Both register the pool with JMX and + expose active workers and queued tasks through `ThreadPoolMetrics`. +- Base the worker thread prefix and monitored pool name on `ThreadName`. Give pools that + coexist in one JVM distinct names, and add new enum entries to the corresponding module set. + Shut down the pool when its owner stops so the wrapper unregisters its MBean and metrics. +- For pools whose core workers should retire when idle, use + `newFixedThreadPoolWithIdleThreadTimeout` or set a positive keep-alive time and call + `allowCoreThreadTimeOut(true)` on the wrapped executor. + ## Architecture ### Node Types
