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

Asynchronous tasks ID sequence can exhaust

Aperta
#277 0 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
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
django, postgresql, python
Ambito
backend, databases

Direzione di ricerca

Start by locating the Task model and checking its primary-key references and migrations; the issue does not name specific files or tests. Verify what depends on numeric task IDs before changing the key. Done means Task.uuid is the UUID4 primary key, the sequence is removed, and no logic depends on numeric task IDs.

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

Descrizione

In some Flagsmith installs with a lot of dashboard activity and analytics turned on, the Task.id field can yield a sequence exhaustion error in Postgres:

django.db.utils.DataError: nextval: reached maximum value of sequence "task_processor_task_id_seq" (2147483647)

Although https://github.com/Flagsmith/flagsmith/pull/5358 has alleviated the accumulation of items by preventing /api/v1/flags/ from enqueuing new tasks for analytics tracking, we're bound to hit that limit eventually.

Seemingly, this only affects instances with analytics enabled. As such, a temporary fix includes:

  1. Upgrading Flagsmith to a version equal or newer than v2.173.1. This alone should postpone the exhaustion by many years in most installs.
  2. Shifting the sequence axis so it consumes negative numbers, i.e.:
ALTER SEQUENCE task_processor_task_id_seq MINVALUE -2147483648 RESTART WITH -2147483648;

Acceptance criteria

  • Promote Task.uuid to a primary key defaulting to UUID4(), dismissing a sequence entirely. Must ensure no logic depends on numeric task IDs.
Lingua principale
Python
Stelle
2
Fork
4
Merge medio
1h 7m
PR unite (30g)
4

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 Flagsmith/flagsmith-common

Tutte le issue di Flagsmith/flagsmith-common

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.