Skip to content

[scheduler] Enqueue jobs that must run immediately - #215

Open
sduenas wants to merge 1 commit into
chaoss:mainfrom
sduenas:fix-lost-scheduled-jobs
Open

sduenas wants to merge 1 commit into
chaoss:mainfrom
sduenas:fix-lost-scheduled-jobs

Conversation

@sduenas

@sduenas sduenas commented Nov 11, 2026

Copy link
Copy Markdown
Member

Jobs scheduled to run immediately could be lost and never executed. RQ versions older than 3.0 add the job id to the scheduled registry before the job is stored in Redis. If the RQ scheduler reads the registry in between, it removes the id without enqueuing the job, so the job is never run and no error is reported.

Jobs that must run immediately are now added to the queue directly. Jobs scheduled in the future still use the scheduled registry, because the RQ scheduler doesn't read them until they are due.

Assisted-by: Claude:claude-opus-5.5

@sduenas
sduenas force-pushed the fix-lost-scheduled-jobs branch from bf53e2f to 29154e0 Compare November 12, 2026 08:38
Jobs scheduled to run immediately could be lost and never
executed. RQ versions older than 3.0 add the job id to the
scheduled registry before the job is stored in Redis. If the
RQ scheduler reads the registry in between, it removes the id
without enqueuing the job, so the job is never run and no error
is reported.

Jobs that must run immediately are now added to the queue
directly. Jobs scheduled in the future still use the scheduled
registry, because the RQ scheduler doesn't read them until
they are due.

Signed-off-by: Santiago Dueñas <sduenas@grimoirelab.org>
Assisted-by: Claude:claude-opus-5.5
@sduenas
sduenas force-pushed the fix-lost-scheduled-jobs branch from 29154e0 to a34e6a6 Compare November 12, 2026 17:48
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.

1 participant