Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(celery): Kill celery worker process after every task to release memory #6761

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

vicferpoy
Copy link
Member

@vicferpoy vicferpoy commented Jan 31, 2025

Context

Imported resources from Prowler SDK would remain in memory when deploying the Prowler App locally after running scans because Celery worker child processes were not released.

Fixes #6752

Description

Through a configuration parameter, we are replacing each worker child process after executing a task: https://docs.celeryq.dev/en/latest/userguide/workers.html#max-tasks-per-child-setting

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@vicferpoy vicferpoy added the backport-to-v5.2 Backport PR to the v5.2 branch label Jan 31, 2025
@vicferpoy vicferpoy requested a review from a team as a code owner January 31, 2025 13:33
Copy link
Member

@jfagoagas jfagoagas left a comment

Choose a reason for hiding this comment

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

🔒 Thank you!

Copy link

codecov bot commented Jan 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.52%. Comparing base (1256c04) to head (0a236ca).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6761      +/-   ##
==========================================
+ Coverage   88.71%   93.52%   +4.80%     
==========================================
  Files        1195       67    -1128     
  Lines       34490     6330   -28160     
==========================================
- Hits        30598     5920   -24678     
+ Misses       3892      410    -3482     
Flag Coverage Δ
api 93.52% <ø> (?)
prowler ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
prowler ∅ <ø> (∅)
api 93.52% <ø> (∅)

@jfagoagas jfagoagas merged commit 763130f into master Jan 31, 2025
13 checks passed
@jfagoagas jfagoagas deleted the fix/celery-worker-child-memory branch January 31, 2025 13:45
@prowler-bot prowler-bot added the was-backported The PR was successfully backported to the target branch label Jan 31, 2025
@prowler-bot
Copy link
Collaborator

💚 All backports created successfully

Status Branch Result
v5.2

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-v5.2 Backport PR to the v5.2 branch component/api was-backported The PR was successfully backported to the target branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WebUi scheduled scan issue
3 participants