Aias00 opened a new issue, #6660:
URL: https://github.com/apache/shenyu/issues/6660
- Severity: High
- Location:
`shenyu-disruptor/src/main/java/org/apache/shenyu/disruptor/thread/OrderlyExecutor.java:37,66-77`;
`shenyu-disruptor/src/main/java/org/apache/shenyu/disruptor/provider/DisruptorProvider.java:114-121`
-
Description:
In orderly mode `OrderlyExecutor` populates `virtualExecutors` (a
`ConcurrentSkipListMap<Long, SingletonExecutor>`) with `corePoolSize`
`SingletonExecutor` instances, each its own `ThreadPoolExecutor(1,1,…,new
LinkedBlockingQueue<>(), threadFactory)`. `DisruptorProvider.shutdown()` only
calls `executor.shutdown()` on the outer `OrderlyExecutor`; `OrderlyExecutor`
does not override `shutdown()`/`shutdownNow()` to cascade. The worker thread
factory is `DisruptorThreadFactory.create("shenyu_disruptor_consumer_", false)`
— `daemon=false` (`DisruptorProviderManage.java:110`) — so the leaked workers
are non-daemon and keep the JVM alive.
-
Impact:
After `DisruptorProvider.shutdown()` in orderly mode, `corePoolSize`
non-daemon threads (default `availableProcessors()*2`) stay alive forever; JVM
cannot exit cleanly. Hot-reload/repeated-init leaks threads each cycle.
-
Suggested fix:
Override `shutdown()`/`shutdownNow()` in `OrderlyExecutor` to iterate
`virtualExecutors.values()` and shut down each `SingletonExecutor`, then
`super.shutdown()`.
-
Confidence: High
- Related existing: #6262 — but the merged fix only added outer
`executor.shutdown()`; inner `SingletonExecutor` leak unfixed. Distinct facet.
---
_Identified during the 2026-08-02 deep re-scan; full list in
[`docs/scan2-2026-08-02/00-consolidated-critical-high.md`](docs/scan2-2026-08-02/00-consolidated-critical-high.md)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]