Closed AChekroun closed 8 months ago
Hi @OlegDokuka, could I give this one a try?
I'm thinking of placing try-catch checks around the delegate.schedule
calls in TimedScheduler
to remove the pending status on rejection. This doesn't seem to affect the periodic version because it doesn't create a pending sample. Does that seem alright?
Thanks.
Hi @OlegDokuka, could I give this one a try?
I'm thinking of placing try-catch checks around the
delegate.schedule
calls inTimedScheduler
to remove the pending status on rejection. This doesn't seem to affect the periodic version because it doesn't create a pending sample. Does that seem alright?Thanks.
please do!
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.6