-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
NetBox version
v3.3.8
Feature type
Change to existing functionality
Proposed functionality
Allow changing the used RQ queue for webhook scheduling, custom scripts and reports to a specific queue.
Use case
Currently script/report and webhook execution uses the same queue ("default"). One RQ worker will only ever run one job at a time:
Each worker will process a single job at a time. Within a worker, there is no concurrent processing going on. If you want to perform jobs concurrently, simply start more workers.
For webhooks we want to only ever run one job at the time, as the order is very important to avoid a webhook referencing a related object that hasn't been sent in a webhook yet.
For scripts/reports the user might not care about the order of executions, but as it stands now if the user runs one rqworker, long running scripts will block both webhooks and other scripts from execution before it is done.
If the user starts multiple rqworkers that will allow multiple scripts to run at a time, but it will also allow multiple webhooks to be sent at a time, which in turn can create situations where a newer webhook is done processing before an older one - imagine three workers all picking up a job at the same time, the webhook will potentially send the HTTP request at roughly the same time, which one goes first depends on CPU scheduling or other external factors.
Allowing webhooks to be configured to use a seperate queue will allow the user to start one worker for webhooks and multiple workers for script/report execution, without risking data consistency issues with webhooks.
Database changes
None
External dependencies
None