-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
Add execution metadata to scheduled tasks #24560
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Comments
We'd rather expose the metadata only for now as a first step. |
jhoeller
added a commit
that referenced
this issue
Jun 12, 2024
Includes defensive test arrangement for isInThePast() with at least 1 ms having passed. See gh-24560
snicoll
pushed a commit
to snicoll/spring-boot
that referenced
this issue
Jun 19, 2024
Spring Framework wraps `Task` and `ScheduledTask` runnables to collect and share metadata about task execution and scheduling. The `ScheduledTasksEndpoint` descriptors were relying on the fact that tasks would never be wrapped. Spring Framework already wrapped runnables in various cases, for methods returning `Callable` or reactive types. This commit makes use of the `toString()` method to describe the runnable. Runnable implementations can override this method for displaying purposes on the actuator endpoint. See spring-projects/spring-framework#24560
wilkinsona
pushed a commit
to spring-projects/spring-boot
that referenced
this issue
Jun 20, 2024
Spring Framework wraps `Task` and `ScheduledTask` runnables to collect and share metadata about task execution and scheduling. The `ScheduledTasksEndpoint` descriptors were relying on the fact that tasks would never be wrapped. Spring Framework already wrapped runnables in various cases, for methods returning `Callable` or reactive types. This commit makes use of the `toString()` method to describe the runnable. Runnable implementations can override this method for displaying purposes on the actuator endpoint. See spring-projects/spring-framework#24560 See gh-41177
bclozel
added a commit
to spring-projects/spring-boot
that referenced
this issue
Jul 25, 2024
As of spring-projects/spring-framework#24560, Spring provides additional metadata for scheduled tasks: * next execution time * last execution outcome (including status, time and raised exception) This commit leverages this information to enhance the existing `scheduledtasks` Actuator endpoint. Closes gh-17585
bclozel
added a commit
that referenced
this issue
Dec 10, 2024
This commit fixes a regression introduced by gh-24560, when adding execution metadata support for scheduled tasks. The `OutcomeTrackingRunnable` would delegate to the actual runnable but could also hide whether it implements the `SchedulingAwareRunnable` contract. This commit ensures that `OutcomeTrackingRunnable` always implements that contract and delegates to the runnable if possible, or return default values otherwise. Fixes gh-34058
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
@enesify requested an enhancement on Spring Boot, where actuator endpoints could provide more information about scheduled tasks.
Currently, the
/actuator/scheduledtasks
actuator endpoint provides information about scheduled tasks, including their type, target and scheduling information.The enhancement request would require more metadata being present on the tasks themselves, such as:
The issue also requests the ability to change a cron expression or to manually trigger a task. For that, Spring Boot would need a unique identifier for each task, which they don't have at the moment.
See spring-projects/spring-boot#17585 for context.
The text was updated successfully, but these errors were encountered: