With virtual threads enabled, separate fixed-delay tasks cannot run concurrently #31900
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: documentation
A documentation task
Milestone
Framework: 6.1.2
Boot: 3.2.1
With
spring.threads.virtual.enabled=true
and otherwise default config, all methods annotated with@Scheduled(fixedDelay = ...)
are executed on the same virtual thread, preventing multiple scheduled methods from running at the same time.cron
andfixedRate
tasks are not limited like this and run on separate threads (but of course allow executions of the same task to overlap).The documentation states:
This behaviour is most likely due to #31334, but shouldn't separate fixed-delay tasks still be allowed to run in parallel?
The following demonstrates this behaviour:
This produces output like this, showing that even while one task is blocked, the other one has to wait:
Is this behaviour intentional? If so, I would have expected a note about this in the docs...
The text was updated successfully, but these errors were encountered: