-
Notifications
You must be signed in to change notification settings - Fork 41.9k
ScheduledTasksEndpoint throws NPE if PeriodicTrigger is used with custom SchedulingConfigurer #36081
Copy link
Copy link
Closed
Labels
type: regressionA regression from a previous releaseA regression from a previous release
Milestone
Description
When using org.springframework.scheduling.support.PeriodicTrigger trigger with custom SchedulingConfigurer NPE is thrown because PeriodicTrigger is without initial duration
11:00:08.565 ERROR [http-nio-9898-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: java.lang.NullPointerException: Cannot invoke "java.time.Duration.toMillis()" because the return value of "org.springframework.scheduling.support.PeriodicTrigger.getInitialDelayDuration()" is null] with root cause
java.lang.NullPointerException: Cannot invoke "java.time.Duration.toMillis()" because the return value of "org.springframework.scheduling.support.PeriodicTrigger.getInitialDelayDuration()" is null
at org.springframework.boot.actuate.scheduling.ScheduledTasksEndpoint$IntervalTaskDescriptor.<init>(ScheduledTasksEndpoint.java:189)
at org.springframework.boot.actuate.scheduling.ScheduledTasksEndpoint$FixedDelayTaskDescriptor.<init>(ScheduledTasksEndpoint.java:214)
at org.springframework.boot.actuate.scheduling.ScheduledTasksEndpoint$TaskDescriptor.describeTriggerTask(ScheduledTasksEndpoint.java:152)
at org.springframework.boot.actuate.scheduling.ScheduledTasksEndpoint$TaskDescriptor.lambda$static$3(ScheduledTasksEndpoint.java:127)
...
Since PeriodicTrigger.getInitialDelayDuration() is @Nullable, probably IntervalTaskDescriptor should have some sort of null check for that.
Spring Boot 3.1.1, Spring Framework 6.0.10
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type: regressionA regression from a previous releaseA regression from a previous release