Skip to content

Replace croniter with cronsim#363

Merged
chrisguidry merged 1 commit intomainfrom
362-croniter-memory-leak
Mar 10, 2026
Merged

Replace croniter with cronsim#363
chrisguidry merged 1 commit intomainfrom
362-croniter-memory-leak

Conversation

@chrisguidry
Copy link
Copy Markdown
Owner

croniter 6.0.0 has two unbounded memory leaks
(#182,
#195) that are
fixed in main but unreleased — and the project was declared unmaintained
by Pallets Community Ecosystem in March 2025, so no release is coming.
It also drags in pytz and python-dateutil as transitive deps.

cronsim is actively maintained (~280 lines, zero deps, Python 3.10+),
used in production by Healthchecks.io, and handles DST via zoneinfo
natively. One gap: cronsim doesn't support Vixie keywords (@daily,
@hourly, etc.), so we add a small mapping dict that expands them before
passing to CronSim.

Also extracted Cron.next_time() so tests mock at docket's abstraction
level rather than the library's internals, and added contract tests that
exercise the real cronsim integration (sequential times, timezone
handling, keyword validity).

Companion conda-forge PR: conda-forge/pydocket-feedstock#34

Closes #362

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

croniter 6.0.0 has two unbounded memory leaks
([#182](pallets-eco/croniter#182),
[#195](pallets-eco/croniter#195)) that are
fixed in main but unreleased — and the project was declared unmaintained
by Pallets Community Ecosystem in March 2025, so no release is coming.
It also drags in pytz and python-dateutil as transitive deps.

cronsim is actively maintained (~280 lines, zero deps, Python 3.10+),
used in production by Healthchecks.io, and handles DST via zoneinfo
natively. One gap: cronsim doesn't support Vixie keywords (@daily,
@hourly, etc.), so we add a small mapping dict that expands them before
passing to CronSim.

Also extracted `Cron.next_time()` so tests mock at docket's abstraction
level rather than the library's internals, and added contract tests that
exercise the real cronsim integration (sequential times, timezone
handling, keyword validity).

Companion conda-forge PR: conda-forge/pydocket-feedstock#34

Closes #362

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 docket | 🛠️ Build #31741728 | 📁 Comparing 650a991 against latest (7f14054)


🔍 Preview build

Show files changed (1 files in total): 📝 1 modified | ➕ 0 added | ➖ 0 deleted
File Status
api-reference/index.html 📝 modified

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (4ab39d2) to head (650a991).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #363   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          108       108           
  Lines         3166      3172    +6     
  Branches        26        26           
=========================================
+ Hits          3166      3172    +6     
Flag Coverage Δ
cli-python-3.10 100.00% <ø> (ø)
cli-python-3.11 100.00% <ø> (ø)
cli-python-3.12 100.00% <ø> (ø)
cli-python-3.13 100.00% <ø> (ø)
cli-python-3.14 100.00% <ø> (ø)
python-3.10 100.00% <100.00%> (ø)
python-3.11 98.08% <100.00%> (+0.03%) ⬆️
python-3.12 100.00% <100.00%> (ø)
python-3.13 100.00% <100.00%> (ø)
python-3.14 100.00% <100.00%> (ø)
windows-python-3.10 100.00% <100.00%> (ø)
windows-python-3.11 97.96% <100.00%> (+<0.01%) ⬆️
windows-python-3.12 100.00% <100.00%> (ø)
windows-python-3.13 100.00% <100.00%> (ø)
windows-python-3.14 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/docket/dependencies/_cron.py 100.00% <100.00%> (ø)
tests/fundamentals/test_cron.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chrisguidry chrisguidry merged commit 562f060 into main Mar 10, 2026
92 of 93 checks passed
@chrisguidry chrisguidry deleted the 362-croniter-memory-leak branch March 10, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Croniter has memory leak

2 participants