Skip to content

Only honor eager flag on workers, not on the API#8145

Merged
johnewart merged 2 commits intorelease-2.84from
johnewart/2.84/eager-only-on-workers
May 8, 2026
Merged

Only honor eager flag on workers, not on the API#8145
johnewart merged 2 commits intorelease-2.84from
johnewart/2.84/eager-only-on-workers

Conversation

@johnewart
Copy link
Copy Markdown
Collaborator

Except when running tests, this prevents the API from having jobs be consumed eagerly if the eager flag is turned on; there are good reasons to want workers to be eager but not the API so going forward the relevant eager flags are only honored by workers.

@johnewart johnewart requested a review from rayharnett May 8, 2026 16:45
@johnewart johnewart requested a review from a team as a code owner May 8, 2026 16:45
@johnewart johnewart requested review from galvana and removed request for a team May 8, 2026 16:45
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
fides-plus-nightly Ignored Ignored Preview May 8, 2026 5:18pm
fides-privacy-center Ignored Ignored May 8, 2026 5:18pm

Request Review

Copy link
Copy Markdown
Contributor

@rayharnett rayharnett left a comment

Choose a reason for hiding this comment

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

Looks good to me. Simple fix to ensure non celery workers disregard always_eager config setting.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

❌ Patch coverage is 85.36585% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.82%. Comparing base (8c07ef4) to head (a46779a).
⚠️ Report is 1 commits behind head on release-2.84.

Files with missing lines Patch % Lines
src/fides/api/tasks/__init__.py 50.00% 2 Missing and 2 partials ⚠️
src/fides/api/worker/__init__.py 93.54% 1 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (85.36%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project check has failed because the head coverage (84.82%) is below the target coverage (85.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@               Coverage Diff                @@
##           release-2.84    #8145      +/-   ##
================================================
- Coverage         84.83%   84.82%   -0.01%     
================================================
  Files               633      633              
  Lines             41736    41762      +26     
  Branches           4880     4884       +4     
================================================
+ Hits              35406    35426      +20     
- Misses             5222     5225       +3     
- Partials           1108     1111       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@johnewart johnewart merged commit c1292a5 into release-2.84 May 8, 2026
63 of 65 checks passed
@johnewart johnewart deleted the johnewart/2.84/eager-only-on-workers branch May 8, 2026 17:31

# Non-worker processes (e.g. the FastAPI app) must not execute tasks eagerly in-process;
# ``fides.api.worker`` sets ``FIDES_CELERY_WORKER`` and syncs ``task_always_eager`` from CONFIG.
if not config.test_mode and os.environ.get("FIDES_CELERY_WORKER") != "1":
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

post-merge nit: couldn't we just reuse _honor_configured_celery_eager_execution? seems a bit strange to me that we need the criteria/logic here defined in two places, but maybe i'm missing something obvious!

clearly not a blocker, just noticed in passing and wanted to flag

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.

3 participants