SimpleAsyncTaskScheduler: consistently apply default error handling #32298
Closed
Description
Affects: 6.1.4 (virtual threads enabled)
SimpleAsyncTaskScheduler
does apply default error handling (and logging) for:
schedule(Runnable task, Trigger trigger)
scheduleWithFixedDelay(Runnable task, Instant startTime, Duration delay)
scheduleWithFixedDelay(Runnable task, Duration delay)
but does not apply it for:
schedule(Runnable task, Instant startTime)
scheduleAtFixedRate(Runnable task, Instant startTime, Duration period)
scheduleAtFixedRate(Runnable task, Duration period)
i think default error handling (especially logging) should be applied in all cases.
ill reference a repro sample app that uses schedule(Runnable task, Instant startTime)
.
running the app, you can see corresponding stderr output but no other handling/logging taking place:
2024-02-20T12:46:53.948+01:00 INFO 2924 --- [ main] com.example.demo.DemoApplication : Started DemoApplication in 0.605 seconds (process running for 0.99)
Exception in thread "scheduling-2" java.lang.IllegalStateException: o.O
at com.example.demo.Sample.lambda$init$0(Sample.java:21)
at java.base/java.lang.VirtualThread.run(VirtualThread.java:309)
thanks & regards.