Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Worker is trying to rescue jobs from queues that are not assigned to it

Aperta
#1,105 12 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
50/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, postgresql
Ambito
backend, databases

Direzione di ricerca

Start with riverdriver/riverpgxv5/internal/dbsqlc/river_job.sql at the rescue query and internal/maintenance/job_rescuer.go around makeRetryDecision. Trace how queue assignments and registered job types are used during rescue, then review the Inserting and working jobs and Multiple queues documentation. Done means the intended behavior is confirmed and the queue-registration requirement or rescue behavior is made unambiguous.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

A bit of context

We have two kinds of workers at the moment, sharing the same database, let's say worker-1 is running jobs from queue-1 and worker-2 is running jobs from queue-2. However, we are using the same binary for the worker and we recently tried registering jobs conditionally, basically registering only those jobs that are supposed to be executed by this worker based on queue selection.

Another thing to mention is that our RescueStuckJobsAfter is configured to be pretty small (30s) whereas timeouts on the jobs are minutes.

An issue

After introducing this conditional registration, we observed the following behaviour:

Checked documentation if we are missing something, and both pages that could have mention any details of this behaviour are not saying anything about our weird case:

  • Inserting and working jobs does not mention if all jobs from a single database have to be registered in all workers
  • Multiple queues only says but workers will only select jobs to work for queues that they're configured to handle, but still it is unclear if we should register all jobs or not

A very bad side effect of this for us was that discarded job continued execution (context wasn't cancelled) and another job with the same unique_key was scheduled, violating unique constraint that we are relying on for correctness, but I am not blaming this on river, this is a consequence of our ignorance of rescue mechanics nuances.


Short-term we fixed our issue by again registering all jobs in the worker binary regardless its configuration, but it would be valuable to have an answer if this is a designed behaviour or a bug?

Lingua principale
Go
Stelle
5.7k
Fork
179
Merge medio
2g 19h
PR unite (30g)
12

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di riverqueue/river

Tutte le issue di riverqueue/river

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.