Skip to content

[PR #1189/7aaf53fc backport][3.27] Fix repair_metadata OOM on large repositories#1196

Merged
jobselko merged 1 commit into3.27from
patchback/backports/3.27/7aaf53fc2f2a46f21be5363e677f503d6ea86fc9/pr-1189
Apr 14, 2026
Merged

[PR #1189/7aaf53fc backport][3.27] Fix repair_metadata OOM on large repositories#1196
jobselko merged 1 commit into3.27from
patchback/backports/3.27/7aaf53fc2f2a46f21be5363e677f503d6ea86fc9/pr-1189

Conversation

@patchback
Copy link
Copy Markdown

@patchback patchback bot commented Apr 14, 2026

This is a backport of PR #1189 as merged into main (7aaf53f).

Summary

  • Reduce BULK_SIZE from 1000 to 250, flushing batches 4x more often to cap peak memory
  • Eliminate double S3 read per wheel by reusing the temp file from metadata extraction for metadata artifact creation
  • Explicitly close artifact file handles after each iteration to release S3 buffer memory

Fixes #1188

Test plan

  • Existing test_repair.py tests pass (metadata repair command, endpoint, artifact repair)
  • New test_metadata_repair_batch_boundary passes with reduced BULK_SIZE
  • Deploy to stage and run repair-python-metadata.py --env stage --domain <large-domain> to verify no OOM

JIRA: PULP-1573

🤖 Generated with Claude Code

Fix repair_metadata OOM on large repositories

(cherry picked from commit 7aaf53f)
@jobselko jobselko merged commit 6c3f591 into 3.27 Apr 14, 2026
14 checks passed
@jobselko jobselko deleted the patchback/backports/3.27/7aaf53fc2f2a46f21be5363e677f503d6ea86fc9/pr-1189 branch April 14, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant