Skip to content

Release stale content pins during maintenance - #122

Closed
LIghtJUNction wants to merge 1 commit into
mainfrom
codex/propose-fix-for-pinned-chunk-vulnerability
Closed

LIghtJUNction wants to merge 1 commit into
mainfrom
codex/propose-fix-for-pinned-chunk-vulnerability

Conversation

@LIghtJUNction

Copy link
Copy Markdown
Member

Motivation

  • Expired transfers and purged revisions removed SQLite metadata but left explicit CAS pins in place, preventing physical reclamation of orphaned bytes and enabling unbounded disk growth.

Description

  • When purging revisions, release the content store pin for each revision before deleting its revision rows by calling await app.contents.unpin(revision.content, revision.id) in src/msg/workers/maintenance.py.
  • When marking transfers expired, unpin every chunk for that transfer and any sealed-output pin before deleting chunk records by iterating chunks and calling await app.contents.unpin(...) in src/msg/workers/maintenance.py.
  • Added a regression test test_expired_transfer_releases_chunk_pins_for_collection in tests/test_transfer.py that exercises an upload, forces expiration, runs cleanup_expired, and then runs the collector to verify previously-pinned chunk bytes become garbage-collectable.
  • Files changed: src/msg/workers/maintenance.py and tests/test_transfer.py.

Testing

  • Ran static checks with uvx ruff check src/msg/workers/maintenance.py tests/test_transfer.py which passed after auto-fix formatting.
  • Verified bytecode compilation with python -m compileall (fallback Python 3.14 used in the environment) which succeeded for the modified files.
  • Ran repository checks with git diff --check which reported no problems after changes.
  • Attempted to run pytest -q tests/test_transfer.py, but full test execution is blocked in this environment because the project requires Python 3.15 and the fallback Python 3.14 environment lacks psycopg, so end-to-end pytest runs could not be completed here.

Codex Task

Copilot AI lite review requested due to automatic review settings September 28, 2026 11:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-09-28T11:52:51.122132Z 471d2e2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@LIghtJUNction

Copy link
Copy Markdown
Member Author

Superseded by merged #142 (edf0d55). This branch targets the pre-integration tree and would duplicate or conflict with the security repairs already on main.

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