Skip to content

Log errors from failing Perpetual tasks#361

Merged
chrisguidry merged 2 commits intomainfrom
360-perpetual-log-errors
Mar 6, 2026
Merged

Log errors from failing Perpetual tasks#361
chrisguidry merged 2 commits intomainfrom
360-perpetual-log-errors

Conversation

@chrisguidry
Copy link
Copy Markdown
Owner

When a Perpetual task fails, on_complete() returns True which tells the Worker "I handled it" — skipping the normal error log. The reschedule works fine, but the exception is completely invisible. Now we log at ERROR with the full traceback before the reschedule info line.

Also fixes the logger names in the private dependency modules (_perpetual, _concurrency, _retry) to use docket.dependencies instead of leaking internal names like docket.dependencies._perpetual into log output.

Closes #360

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

When a Perpetual task fails, `on_complete()` returns `True` which tells
the Worker "I handled it" — skipping the normal error log. The reschedule
works fine, but the exception is completely invisible. Now we log at ERROR
with the full traceback before the reschedule info line.

Also fixes the logger names in the private dependency modules
(`_perpetual`, `_concurrency`, `_retry`) to use `docket.dependencies`
instead of leaking internal names like `docket.dependencies._perpetual`
into log output.

Closes #360

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

Documentation build overview

📚 docket | 🛠️ Build #31693039 | 📁 Comparing af039e5 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 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (7f14054) to head (58bbb93).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #361   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          108       108           
  Lines         3163      3166    +3     
  Branches        26        26           
=========================================
+ Hits          3163      3166    +3     
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.04% <100.00%> (+<0.01%) ⬆️
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.95% <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/_concurrency.py 100.00% <ø> (ø)
src/docket/dependencies/_perpetual.py 100.00% <ø> (ø)
src/docket/dependencies/_retry.py 100.00% <ø> (ø)
tests/fundamentals/test_perpetual.py 100.00% <100.00%> (ø)
tests/fundamentals/test_retries.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Same fix as the Perpetual error logging — Retry.handle_failure() was
returning True and swallowing the exception. Now each retry attempt
logs the error at ERROR level with the full traceback before the
reschedule info line.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chrisguidry chrisguidry merged commit 4ab39d2 into main Mar 6, 2026
91 of 92 checks passed
@chrisguidry chrisguidry deleted the 360-perpetual-log-errors branch March 6, 2026 13:51
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.

Perpetual silently swallows task exceptions

2 participants