Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #669 +/- ##
==========================================
+ Coverage 82.86% 82.88% +0.01%
==========================================
Files 69 69
Lines 2749 2752 +3
==========================================
+ Hits 2278 2281 +3
Misses 471 471 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
danfimov
left a comment
There was a problem hiding this comment.
Thank you for contribution)
Please fix couple minor things. And after that I think we can merge this MR.
|
Please run linters locally. I see that ruff is failing in CI |
…id-cron-offset-crash
|
I ran the linters locally before pushing, with both the locked ruff (0.16.5) and the latest one, and this branch passes. The errors in the CI lint job don't come from this PR's changes, they come from the merge with master. #627 (b5d6033, merged after this PR was opened) introduced them: 5 auto-fixable If it helps, I can send a small separate PR that fixes master's lint (apply the 5 auto-fixes and extract a small helper from |
|
Yep, found the same problem. Will merge this MR with fixes for pre-commit checks first, after that will rebase your MR and merge it too |
Closes: #668
is_cron_task_nowcalledZoneInfo(offset)outside thetry/exceptthat converts errors intoCronValueError, and the scheduler loop only catchesCronValueError. One schedule with a non-IANAcron_offsetstring (e.g. the natural spelling"UTC+3") raisedZoneInfoNotFoundErrorout ofSchedulerLoop.runand killed the whole scheduler process.With this change a bad offset goes through the same path as an invalid cron expression:
CronValueErroris raised, the loop logs the existingCannot parse cronwarning and skips that schedule.Two regression tests cover invalid offset strings: the natural spelling
"UTC+3"and a typo'd timezone name ("Europa/Madrid"). Both fail on master withZoneInfoNotFoundErrorand pass with this change.Complements #625 (which fixes duration-string offsets at model-validation time but leaves the runtime guard unhandled).
Validation: full suite passes (
pytest -q, 324 tests),black,ruffandmypyclean.