-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PendingTasks leak in TimedScheduler #3642
Comments
Hi @OlegDokuka, could I give this one a try? I'm thinking of placing try-catch checks around the Thanks. |
please do! |
Fixes issue with TimedScheduler where tasks rejected by underlying scheduler would not be removed from pendingTaks count. Idea is to catch any RejectedExecutionException thrown when scheduling the task, stop its pending sample to remove it from the pending count, and rethrow the error so caller knows that the task was rejected. Fixes reactor#3642.
Fixes issue with TimedScheduler where tasks rejected by underlying scheduler would not be removed from pendingTaks count. Idea is to catch any RejectedExecutionException thrown when scheduling the task, stop its pending sample to remove it from the pending count, and rethrow the error so caller knows that the task was rejected. Fixes reactor#3642.
Fixes issue with TimedScheduler where tasks rejected by underlying scheduler would not be removed from pendingTaks count. Idea is to catch any RejectedExecutionException thrown when scheduling the task, stop its pending sample to remove it from the pending count, and rethrow the error so caller knows that the task was rejected. Fixes reactor#3642
Fixes issue with TimedScheduler where tasks rejected by underlying scheduler would not be removed from pendingTaks count. Idea is to catch any RejectedExecutionException thrown when scheduling the task, stop its pending sample to remove it from the pending count, and rethrow the error so caller knows that the task was rejected. Fixes reactor#3642
Fixes issue with TimedScheduler where tasks rejected by underlying scheduler would not be removed from pendingTaks count. Idea is to catch any RejectedExecutionException thrown when scheduling the task, stop its pending sample to remove it from the pending count, and rethrow the error so caller knows that the task was rejected. Fixes reactor#3642
Can changes by applied to all kind of exception? My case - I have schedulers metrics in DataDog, and starting from some point any type of scheduler can start produce incomplete scheduled tasks metric from 0 task to millions of them. I guess problem not only in RejectedExecutionException since I use only project reactor and subscribeOn/publishOn methods. |
@BarexaS, the fix for this particular bug involves handling exceptions that we anticipate can happen in the API that is controlled by us, so we can stay focused on incremental improvements and get this fix incorporated in the current form to adhere to the original report. Please do open a new issue with a reproducible example which demonstrates the leak you observe, preferably with minimum dependencies. |
In
TimedScheduler
, micrometer's counterpendingTasks
is never stop if the underlying scheduler reject the task.Expected Behavior
Micrometer's counter
pendingTasks
must be stopped if the underlying scheduler throws aRejectedExecutionException
Actual Behavior
Micrometer's counter
pendingTasks
is not be stopped when the underlying scheduler throws aRejectedExecutionException
, resulting in never ending LongRunningTaskSteps to Reproduce
Possible Solution
Catch any RejectedExecutionException to stop any pending tasks
Your Environment
java -version
): 17.0.6The text was updated successfully, but these errors were encountered: