world-postgres: startup recovery re-enqueues runs without a recorded namespace under the World's own prefix, not the registered flow handler's

Aperta
#5,442 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
50/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
postgresql, typescript
Ambito
databases

Direzione di ricerca

Start at the start() call in packages/world-postgres/src/index.ts, where the TODO points to this issue, and read reenqueueActiveRuns in @workflow/world to see how the fallback namespace is chosen. Find where the flow handler's in-process registration and its namespace are available before start(). Done when runs without a recorded namespace are re-enqueued under that handler's prefix, runs with a recorded namespace are unchanged, and the registration warning is still shown.

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

Descrizione

Summary

On start(), the Postgres World re-enqueues every active run it owns (reenqueueActiveRuns from @workflow/world, called from packages/world-postgres/src/index.ts). A run goes back to the queue namespace it recorded when it was created; a run that recorded none goes to the World's own namespace (the namespace option, or WORKFLOW_QUEUE_NAMESPACE in the World's process).

Since #5315 the World delivers the Workflow SDK's messages in process, to the flow handler the app registered. That handler is registered under the prefix the flow route was built with (WORKFLOW_QUEUE_NAMESPACE at build time). When that prefix differs from the World's own, the World warns once at registration and still delivers what the SDK publishes, but the runs it recovers at startup without a recorded namespace go to its own prefix, which no handler in the process takes: the runner claims the job and fails the delivery.

Intended fix

Recover such runs under the registered flow handler's prefix rather than the World's namespace option: when a flow handler (one carrying the in-process entry) is registered before start(), pass its namespace as the fallback to reenqueueActiveRuns. Runs that recorded a namespace are unaffected.

Current state

The limitation is noted in the Postgres World docs (Programmatic configuration) and in the registration warning, and a TODO at the start() call in packages/world-postgres/src/index.ts points here.

Related: #2978 covers the wider question of isolating applications that share one database; this issue is only about the fallback namespace of recovery inside one application.

Lingua principale
TypeScript
Stelle
2.5k
Fork
401
Merge medio
1g 21h
PR unite (30g)
201

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

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 vercel/workflow

Tutte le issue di vercel/workflow

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.