fix(scheduling): prove every #[Scheduled] duration at boot and read ISO-8601 durations (26.09.11) - #10
Merged
Conversation
added 2 commits
September 30, 2026 21:02
…SO-8601 durations are read as Spring reads them lockTtl was parsed only inside the task closure, so a value Duration::parse refused threw on every tick, was reported and the task never ran while the application booted and looked healthy. ScheduleWiringPass now parses fixedRate, fixedDelay and lockTtl at boot, as it already parsed initialDelay, and refuses the boot naming the method. Duration::parse also accepts ISO-8601 durations (PT14M, PT1H30M, P1D, PT0.25S), the java.time.Duration form Spring's @scheduled reads. Years, months and weeks are refused because their length is not fixed. Found in a Signature CRM deployment whose seven scheduled tasks declared lockTtl: 'PT14M' and never ran.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#[Scheduled]duration is proved at boot.fixedRate,fixedDelayandlockTtlare now parsed byScheduleWiringPass::run(), asinitialDelayalready was, and an unparseable value refuses the boot naming its method.lockTtlused to be parsed only inside the task closure: an invalid value threw on every tick, was reported, and the task never ran while the application booted and looked healthy.Firefly\Resilience\Duration::parsealso readsPT14M,PT1H30M,P1D,PT0.25S— thejava.time.Durationform Spring's@Scheduledreads. Years, months and weeks are refused because their length is not fixed. Resilience settings and every scheduling duration accept it.Found while deploying Signature CRM to Azure Container Apps: its seven scheduled tasks declared
lockTtl: 'PT14M'and none of them ever ran in production mode; the only trace was a genericConfigurationExceptionin the logs.Verification
DurationTest(ISO-8601 accepted and refused cases),ScheduleWiringPassTest(boot refusal forlockTtl,fixedRate,fixedDelay; ISOlockTtlreaches the lock as 240 s).composer validate --strict,composer mono-validate,composer check(Pint, PHPStan, 4,189 tests passed, 6 skipped, deptrac 0 violations) andcomposer test:packageall passed locally.ScheduledTasksTestin the CRM).