Skip to content

Fix ITN cleanup OOM on django_cron - #5338

Merged
hlbmtc merged 1 commit into
mainfrom
fix/itn-cleanup-oom
Nov 24, 2026
Merged

hlbmtc merged 1 commit into
mainfrom
fix/itn-cleanup-oom

Conversation

@hlbmtc

@hlbmtc hlbmtc commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

#5334 didn't stop the nightly R15 on django_cron. The Nov 22–24 runs died one step earlier: memory climbs right after "Synced N ITN articles", before "Running ITN articles embeddings generation" is logged.

  • clear_old_itn_news: ITNArticle has a CASCADE (PostArticle) and a SET_NULL (KeyFactorNews), so .delete() first selects every column of the rows it removes, including article text and 3072-dim embeddings. It now selects only id. Cascades are unchanged
  • A killed run rolls the delete back, so each night retried a bigger set

🤖 Generated with Claude Code

The cascades on ITNArticle make Django select every column of the rows it is
about to delete. With 3072-dim embeddings and full article text that pushed
django_cron past its memory quota every night since Nov 22.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hlbmtc
hlbmtc deployed to testing_env November 24, 2026 10:53 — with GitHub Actions Active
@hlbmtc
hlbmtc deployed to testing_env November 24, 2026 10:53 — with GitHub Actions Active
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@hlbmtc
hlbmtc merged commit 5b2bc03 into main Nov 24, 2026
12 of 14 checks passed
@hlbmtc
hlbmtc deleted the fix/itn-cleanup-oom branch November 24, 2026 10:54

This branch was successfully deployed

1 active deployment
testing_env — 5823dfb7 Deployed Nov 24, 2026 by hlbmtc via integration-tests #8882
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.

1 participant