Skip to content

[FIX] queue_job: job runner open pipe that are never closed properly #754

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

Merged
merged 1 commit into from
Mar 19, 2025

Conversation

petrus-v
Copy link
Contributor

this make a lot of open file descriptors that we got the limit while instentiate jobrunner from queue_job_cron_jobrunner in the current channel implementation #750

@OCA-git-bot
Copy link
Contributor

Hi @guewen,
some modules you are maintaining are being modified, check this out!

@petrus-v petrus-v marked this pull request as ready for review March 14, 2025 15:37
this make a lot of open file descriptors that we got the limit while instentiate
jobrunner from queue_job_cron_jobrunner in the current channel implementation
OCA#750
Copy link
Contributor

@amh-mw amh-mw left a comment

Choose a reason for hiding this comment

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

Code review only, LGTM. If this gets forward-ported to 15 or 18, I would be willing to graph file descriptor counts in one of my long running test environments and report back.

@petrus-v
Copy link
Contributor Author

@amh-mw Thanks for review

Code review only, LGTM. If this gets forward-ported to 15 or 18, I would be willing to graph file descriptor counts in one of my long running test environments and report back.

I don't expect you get that mush open fd using queue_job as it. We discover it by using queue_job_cron_jobrunner and this recent PR #750 where a QueueJobRunner instance is created while acquiring job so we get the limit while handling thousands of jobs quickly. Indeed this is a bit mitigate as workers are restart at some point.

Anyway it's an esay way to mitigate a denial of service attack (assuming attacker is able to execute such code from odoo.addons.queue_job.jobrunner import QueueJobRunner; [QueueJobRunner.from_environ_or_config() for _ in range(2048)] ... well I suppose if an attacker is able to do that it can do more dommage on the server ! ).

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@simahawk
Copy link
Contributor

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 14.0-ocabot-merge-pr-754-by-simahawk-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 296f3d1 into OCA:14.0 Mar 19, 2025
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 1840d7c. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants