-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Description
#24560 breaks custom TaskSchedulers injected in the ScheduledTaskRegistrar, where those schedulers rely on contracts attached to the scheduled Runnable instance. Wrapping it in an OutcomeTrackingRunnable
hides whatever contract the original instance implements.
In our case, for example, the Runnable would implement other interfaces to provide locking information for allowing exclusive execution of schedules in a clustered environment, so that only one node would execute at the time.
With this change, our clustered TaskScheduler cannot see those interfaces and the schedules will run in parallel on all nodes.
Considering that we moved away from using the ScheduledTaskRegistrar and we now use the TaskScheduler directly, but I thought it would be beneficial for the framework if it provided an implementation of the feature that augments the original Runnable instance rather than wrapping it, possibly through a dynamic proxy or other aspect oriented approach.