Skip to content

Conversation

@pakallis
Copy link
Contributor

@pakallis pakallis commented Oct 16, 2025

Fixes #9951

@codecov
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.67%. Comparing base (2f60642) to head (3952f8d).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9952   +/-   ##
=======================================
  Coverage   78.67%   78.67%           
=======================================
  Files         153      153           
  Lines       19304    19305    +1     
  Branches     2212     2212           
=======================================
+ Hits        15188    15189    +1     
  Misses       3817     3817           
  Partials      299      299           
Flag Coverage Δ
unittests 78.65% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pakallis pakallis force-pushed the fix-unpickling-error branch from 7839b23 to 23f8d45 Compare October 16, 2025 11:24
@auvipy auvipy requested review from auvipy and Copilot October 16, 2025 12:49
@auvipy auvipy added this to the 5.6.0 milestone Oct 16, 2025
Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please check why the failing unit tests?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds handling for pickle.UnpicklingError during persistent scheduler initialization and introduces a unit test to validate the behavior. This ensures corrupted pickled entries in the beat schedule do not crash initialization and are handled similarly to other corruption cases.

  • Catch pickle.UnpicklingError when reading/initializing schedule entries in PersistentScheduler._create_schedule
  • Add unit test to verify UnpicklingError triggers store cleanup via _destroy_open_corrupted_schedule
  • Minor test import addition for pickle

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
t/unit/app/test_beat.py Adds a test covering UnpicklingError handling during schedule creation; imports pickle for test exceptions
celery/beat.py Extends exception handling in _create_schedule to include UnpicklingError and adjusts except clause to include dbm.error explicitly

pkallis@douleutaras.com and others added 2 commits October 20, 2025 16:39
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Nusnus Nusnus force-pushed the fix-unpickling-error branch from 85b1529 to babdb98 Compare October 20, 2025 13:39
@auvipy auvipy modified the milestones: 5.6.0, 5.7.0 Oct 20, 2025
@auvipy
Copy link
Member

auvipy commented Oct 21, 2025

now integration tests are failing, can you look into them?

@auvipy auvipy modified the milestones: 5.7.0, 5.6.x Oct 21, 2025
@pakallis
Copy link
Contributor Author

now integration tests are failing, can you look into them?

@auvipy I ran the integration tests in the master branch locally and they fail too. Also, I can't imagine how the failing tests are related to celery beat changes, as they call a task with .delay. Probably flaky or something else I might be missing?

@auvipy
Copy link
Member

auvipy commented Oct 25, 2025

now integration tests are failing, can you look into them?

@auvipy I ran the integration tests in the master branch locally and they fail too. Also, I can't imagine how the failing tests are related to celery beat changes, as they call a task with .delay. Probably flaky or something else I might be missing?

yes, that failures were related to a newer version of dependency which is not related

@auvipy auvipy merged commit 26bee54 into celery:main Oct 25, 2025
107 checks passed
@auvipy
Copy link
Member

auvipy commented Oct 26, 2025

thanks!

@pakallis pakallis deleted the fix-unpickling-error branch October 31, 2025 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Celery beat crashes with: UnpicklingError - invalid load key

2 participants