You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Terminate internally owned delaying-queue executors on shutdown #4977
DefaultDelayingQueue() creates a single-thread executor and submits waitingLoop, but the executor is not retained or shut down. The inherited shutDown() only changes the queue state. Even after the waiting loop returns, the executor's non-daemon worker remains alive waiting for more executor tasks.
DefaultRateLimitingQueue() and controller construction also create executor instances for this path, so ownership and shutdown behavior need to be traced through the affected constructors.
Create a default delaying or rate-limiting queue, then shut it down. Observe that the executor worker stays alive after the waiting loop exits; repeated queue creation/shutdown leaks threads and can prevent JVM termination.
Impact
Thread leaks and incomplete application shutdown, especially when controllers are recreated. Suggested priority: medium.
Requested fix and acceptance criteria
Track and terminate internally owned executors during queue shutdown.
Wake/cancel the waiting task promptly instead of waiting for an arbitrarily distant delayed item's deadline.
Explicitly preserve/document ownership semantics for caller-supplied executors; do not unexpectedly terminate unrelated work on shared executors.
Cover both default queue constructors and controller-created queues where relevant.
Add bounded regression tests proving task/executor termination, idempotent shutdown, and correct handling of caller-supplied executors. Avoid leaking test executors.
Agent instructions
Implement a focused fix, run relevant tests, and open a pull request referencing and closing this issue. Follow the repository's PR template and contribution conventions.
Activity
Fix delaying queue executor ownership and shutdown (#4977)
Fix delaying queue executor ownership and shutdown (#4977)