Skip to content

Fix pickle cache rewrite races#364

Open
shaypal5 wants to merge 7 commits intomasterfrom
codex/release-v4.3.0
Open

Fix pickle cache rewrite races#364
shaypal5 wants to merge 7 commits intomasterfrom
codex/release-v4.3.0

Conversation

@shaypal5
Copy link
Member

@shaypal5 shaypal5 commented Mar 6, 2026

Summary

  • make shared pickle-cache rewrites atomic with a temp file plus os.replace
  • use a sidecar lockfile outside cache directories for shared pickle-cache reads and writes so Windows can replace cache files safely
  • handle moved filesystem events in the pickle watchdog path
  • add regression coverage for concurrent shared-cache rewrites

Context

  • fixes the macOS cleanup failure in tests/test_cleanup.py::test_cleanup_stale_entries
  • fixes the Windows smoke-test regression from replacing an open cache file
  • preserves expected cache-directory contents for separate_files=True and separate_files=False

Files

  • src/cachier/cores/pickle.py
  • tests/pickle_tests/test_pickle_core.py

@shaypal5 shaypal5 added the codex label Mar 6, 2026
@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.94%. Comparing base (98f137b) to head (3cdd940).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##            master     #364      +/-   ##
===========================================
- Coverage   100.00%   99.94%   -0.06%     
===========================================
  Files           12       12              
  Lines         1701     1731      +30     
  Branches       213      216       +3     
===========================================
+ Hits          1701     1730      +29     
- Partials         0        1       +1     
Flag Coverage Δ
local 59.21% <100.00%> (+0.66%) ⬆️
mongodb 40.55% <17.64%> (-0.37%) ⬇️
postgres 43.44% <17.64%> (-0.42%) ⬇️
redis 46.67% <17.64%> (-0.48%) ⬇️
s3 42.46% <17.64%> (-0.40%) ⬇️

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

Files with missing lines Coverage Δ
src/cachier/cores/pickle.py 99.65% <100.00%> (-0.35%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 98f137b...3cdd940. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shaypal5 shaypal5 requested a review from Copilot March 6, 2026 14:14
@shaypal5 shaypal5 requested a review from Borda March 6, 2026 14:15
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

Bumps the Cachier package version to 4.3.0 for the v4.3.0 release.

Changes:

  • Updated the version string from 4.2.0 to 4.3.0

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

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

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.

2 participants