Skip to content

Conversation

@nikitabelonogov
Copy link
Member

DO NOT MERGE

@nikitabelonogov nikitabelonogov requested a review from a team as a code owner December 24, 2025 08:15
@netlify
Copy link

netlify bot commented Dec 24, 2025

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit 05b2287
🔍 Latest deploy log https://app.netlify.com/projects/heartex-docs/deploys/694cfe06841e2e0008c81352

@netlify
Copy link

netlify bot commented Dec 24, 2025

Deploy Preview for label-studio-storybook canceled.

Name Link
🔨 Latest commit 05b2287
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-storybook/deploys/694cfe06da2e5a00089fa875

@netlify
Copy link

netlify bot commented Dec 24, 2025

Deploy Preview for label-studio-docs-new-theme canceled.

Name Link
🔨 Latest commit 05b2287
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-docs-new-theme/deploys/694cfe063d0ba60008f72c43

@github-actions github-actions bot added the ci label Dec 24, 2025
@netlify
Copy link

netlify bot commented Dec 24, 2025

Deploy Preview for label-studio-playground canceled.

Name Link
🔨 Latest commit 05b2287
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-playground/deploys/694cfe064837b8000888d7e0

@codecov
Copy link

codecov bot commented Dec 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.51%. Comparing base (7742910) to head (05b2287).
⚠️ Report is 1 commits behind head on develop.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #9072       +/-   ##
============================================
+ Coverage    39.16%   81.51%   +42.35%     
============================================
  Files          746      271      -475     
  Lines        58564    24491    -34073     
  Branches      9365        0     -9365     
============================================
- Hits         22939    19965     -2974     
+ Misses       35621     4526    -31095     
+ Partials         4        0        -4     
Flag Coverage Δ
lsf-unit ?
pytests 81.51% <ø> (+<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.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member Author

@nikitabelonogov nikitabelonogov left a comment

Choose a reason for hiding this comment

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

Migration Review

🚨 Memory Risk: Removing iterate_queryset and using View.objects.all() directly will load all View objects into memory at once, which can cause OOM errors in production with large datasets.

Recommendation: Use View.objects.all().iterator() to process views in chunks, or use View.objects.all().values('id', 'data') with update() if full model instances aren't needed.


try:
views = iterate_queryset(View.objects.all())
views = View.objects.all()
Copy link
Member Author

Choose a reason for hiding this comment

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

🚨 Memory risk: Using View.objects.all() directly loads all View objects into memory. Use View.objects.all().iterator() to process in chunks.

logger.info(f'Starting reverse migration {migration_name}')

views = iterate_queryset(View.objects.all())
views = View.objects.all()
Copy link
Member Author

Choose a reason for hiding this comment

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

🚨 Same memory risk in reverse migration. Use View.objects.all().iterator() instead.

Copy link
Member Author

@nikitabelonogov nikitabelonogov left a comment

Choose a reason for hiding this comment

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

Summary

🚨 Critical Memory Issue: Removing iterate_queryset reintroduces OOM risk by loading all View objects into memory. Both forward and reverse migrations should use View.objects.all().iterator() to process in chunks.

@nikitabelonogov nikitabelonogov force-pushed the revert-9028-fb-utc-444-oom-fix branch from cb3acac to f16fac4 Compare December 25, 2025 08:46
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Migration Review

⚠️ Missing error handling in reverse migration: The function lacks try/except error handling and AsyncMigrationStatus tracking, unlike the forward migration. If the reverse migration fails, errors won't be logged or tracked properly.

Recommendation: Add error handling and status tracking consistent with .

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Migration Review

⚠️ Missing error handling in reverse migration: The reverse_migration_job function lacks try/except error handling and AsyncMigrationStatus tracking, unlike the forward migration. If the reverse migration fails, errors will not be logged or tracked properly.

Recommendation: Add error handling and status tracking consistent with forward_migration_job.

@nikitabelonogov nikitabelonogov force-pushed the revert-9028-fb-utc-444-oom-fix branch from f16fac4 to 05b2287 Compare December 25, 2025 09:04
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Reviewing migration changes


try:
views = iterate_queryset(View.objects.all())
views = View.objects.all()

Choose a reason for hiding this comment

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

⚡ Performance: Replacing iterate_queryset() with .all() loads all View objects into memory at once, which can cause memory issues or timeouts in production databases with many views. Use iterate_queryset() for safe chunked iteration.

logger.info(f'Starting reverse migration {migration_name}')

views = iterate_queryset(View.objects.all())
views = View.objects.all()

Choose a reason for hiding this comment

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

⚡ Performance: Same issue as forward migration - use iterate_queryset() instead of .all() to handle large querysets safely.

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.

2 participants