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
The repeating sync task was never cancelled on plugin disable,
leaking the timer itself.
Each sync() call spawns an async task that calls
acquireUninterruptibly() on a 5-permit semaphore. The timer fires
up to 50 sync calls per cycle, so 45 threads block indefinitely
waiting for permits. Before they drain, the next cycle spawns 50
more. Threads accumulate until OOM.
Fix: cancel the task on disable, and replace acquireUninterruptibly()
with tryAcquire(5s timeout) in both sync() and unSync() so threads
don't block indefinitely — skipped syncs retry on the next cycle.
Two issues causing unbounded thread growth:
1. The repeating sync task was never cancelled on plugin disable,
leaking the timer itself.
2. Each sync() call spawns an async task that calls
acquireUninterruptibly() on a 5-permit semaphore. The timer fires
up to 50 sync calls per cycle, so 45 threads block indefinitely
waiting for permits. Before they drain, the next cycle spawns 50
more. Threads accumulate until OOM.
Fix: cancel the task on disable, and replace acquireUninterruptibly()
with tryAcquire(5s timeout) in both sync() and unSync() so threads
don't block indefinitely — skipped syncs retry on the next cycle.
FixesEssentialsX#6381
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two issues causing unbounded thread growth:
The repeating sync task was never cancelled on plugin disable,
leaking the timer itself.
Each sync() call spawns an async task that calls
acquireUninterruptibly() on a 5-permit semaphore. The timer fires
up to 50 sync calls per cycle, so 45 threads block indefinitely
waiting for permits. Before they drain, the next cycle spawns 50
more. Threads accumulate until OOM.
Fix: cancel the task on disable, and replace acquireUninterruptibly()
with tryAcquire(5s timeout) in both sync() and unSync() so threads
don't block indefinitely — skipped syncs retry on the next cycle.
Fixes#6381