Skip to content

Allow to track locking information on scheduled tasks #35320

@alienisty

Description

@alienisty

#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)status: waiting-for-feedbackWe need additional information before we can continuestatus: waiting-for-triageAn issue we've not yet triaged or decided on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions