Skip to main content

Run jobs without a dedicated JobRunner

Project description

Alpha License: AGPL-3 OCA/queue Translate me on Weblate Try me on Runboat

This module implements a simple queue.job runner using ir.cron triggers.

It’s meant to be used on environments where the regular job runner can’t be run, like on Odoo.sh.

Unlike the regular job runner, where jobs are dispatched to the HttpWorkers, jobs are processed on the CronWorker threads by the job runner crons. This is a design decision because:

  • Odoo.sh puts HttpWorkers to sleep when there’s no network activity

  • HttpWorkers are meant for traffic. Users shouldn’t pay the price of background tasks.

For now, it only implements the most basic features of the queue_job runner, notably no channel capacity nor priorities. Please check the ROADMAP for further details.

Table of contents

Configuration

Warning

Don’t use this module if you’re already running the regular queue_job runner.

For the easiest case, no configuration is required besides installing the module.

To avoid CronWorker CPU timeout from abruptly stopping the job processing cron, it’s recommended to launch Odoo with --limit-time-real-cron=0, to disable the CronWorker timeout altogether.

Note

In Odoo.sh, this is done by default.

Parallel execution of jobs can be achieved by leveraging multiple ir.cron records:

  • Make sure you have enough CronWorkers available (Odoo CLI --max-cron-threads)

  • Duplicate the queue_job_cron cron record as many times as needed, until you have as much records as cron workers.

Known issues / Roadmap

  • Support channel capacity and priority. (See _acquire_one_job)

  • Gracefully handle CronWorker CPU timeouts. (See _job_runner)

  • Commit transaction after job state updated to started. (See _process)

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • Camptocamp SA

Contributors

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

Current maintainer:

ivantodorovich

This module is part of the OCA/queue project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

File details

Details for the file odoo_addon_queue_job_cron_jobrunner-17.0.1.0.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for odoo_addon_queue_job_cron_jobrunner-17.0.1.0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 106e62e01bfebc21a23396505a2114abf3dfe7b6a943882b5d0c5add375b27ac
MD5 0a72c04527a3c928cf62d4627aff596d
BLAKE2b-256 bf77a7da8d572701db73bf55d6a6cf8fc50c56c3e9688c365b3b2f11d6f3c090

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page