world-postgres: let close() give running deliveries more than graphile's fixed 5 s before aborting them
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- postgresql, typescript
- Ambito
- backend, distributed-systems
Direzione di ricerca
Start by reading PostgresWorldConfig and createQueue, which builds Graphile's run() options; then check how close() calls runner.stop() and how the existing shutdown tests cover running deliveries. Done when the configured grace period reaches Graphile's shutdown timeout, defaults remain compatible, and tests verify deliveries finish within the grace period or are aborted afterward.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
An application-managed shutdown (applicationManagedShutdown: true, then await world.close()) still cuts off any step that has been running for more than 5 seconds when the process is told to stop.
close() calls runner.stop(), which runs graphile-worker's workerPool.gracefulShutdown(). That aborts every running job's abortSignal after gracefulShutdownAbortTimeout, which graphile-worker 0.16.6 fixes at 5 s in its defaults (dist/config.js). world-postgres passes that signal to the loopback delivery (dist/queue.js: "Queue shutdown aborts the delivery through Graphile's signal"), so the delivery is cancelled, the job is failed for a retry, and close() goes on to close the streamer and the pool. Once the process exits, the step that was running is replayed only after the inline ownership lease (WORKFLOW_INLINE_OWNERSHIP_LEASE_SECONDS, 860 s by default) runs out.
On Kubernetes a terminating pod gets a grace period, often 30 to 120 s. Most agent steps (one model call and its tools) finish inside that, but few finish inside 5 s, so every rolling deploy stalls each in-flight step for a lease length.
Environment
@workflow/world-postgres5.0.5,graphile-worker0.16.6 (transitive)- An agent served with
eve start(eve 0.90), Node 24, Kubernetes with a 120 s termination grace period
Ask
A way to set how long close() lets running deliveries finish before it aborts them, for example a shutdownGraceMs option on PostgresWorldConfig (and a WORKFLOW_POSTGRES_SHUTDOWN_GRACE_MS default), passed to graphile-worker as preset.worker.gracefulShutdownAbortTimeout. Today createQueue builds graphile's run() options itself (concurrency, logger, noHandleSignals, pollInterval, taskList), so an application can't pass a preset.
With that, and a server that waits for close() before exiting (vercel/eve#1981, draft vercel/eve#1983), a rolling deploy could stop claiming jobs, let in-flight steps finish inside the platform's grace period, and release only what is still running at the end.
Related
- #4244:
close()resolving while a job is still running, fixed on the 5.x line.
- 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di vercel/workflow
-
getPortLazy re-runs OS port discovery on every call when it finds no portForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
node-module-esbuild-plugin: getImportedIdentifier only checks the first named import when locating a violationForse già presa @div-cowboy l’ha presa 5 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
vercel/workflow#5057 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
code-transform.mdx §ID Generation omits the package-shipped `name@version` ID formForse già presa @Mohith26 l’ha presa 113 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di vercel/workflow
Issue simili
-
db-d1-sqlite: upsert is aliased to updateOne, so payload.kv.set never inserts new keysForse già presa @pcbeingused333 l’ha presa oggi. ApertaBug db: d1-sqlite Payload OSS
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
payloadcms/payload#19766 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
device-management-toolkit/sample-web-ui#3711 ·
I maintainer di solito rispondono entro 1 giorno
-
bug impact:low Team: SecuritySolution Team:Defend Workflows v9.6.0
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
elastic/kibana#306401 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
agentes-chat/agentes-chat#927 ·
I maintainer di solito rispondono entro 1 giorno
-
Closing a pinned tab jumps to the Tabs section instead of the next open pinned tabForse già presa @seenimohamed l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ardia-browser/ardia#2769 ·
I maintainer di solito rispondono entro 1 giorno