workflow-engine: step timeout over ~24.8 days (or Infinity) fires after 1ms

Aperta Adatta ai principianti
#5,970 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@poojagosika ci sta già lavorando.

Dal 7/11/2026.

  • #5976 di @poojagosika — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
84/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
node.js, typescript
Ambito
backend, testing

Direzione di ricerca

Inizia da rivetkit-typescript/packages/workflow-engine/src/context.ts, in corrispondenza di executeWithTimeout, poi leggi l’helper setLongTimeout in utils.ts e come lo usa index.ts. Aggiungi test per timeout superiori a 2^31-1 ms e per Infinity; il lavoro è terminato quando i timeout lunghi non scattano più immediatamente e Infinity disattiva il timeout.

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

Descrizione

executeWithTimeout in rivetkit-typescript/packages/workflow-engine/src/context.ts uses a plain setTimeout(reject, timeoutMs). Node can't wait longer than 2^31-1 ms (~24.8 days) that way: anything bigger, including Infinity, is clamped to 1ms with a TimeoutOverflowWarning.

So a step like this fails right away with StepTimeoutError, even though it would finish fine:

await ctx.step({
name: "long-job",
timeout: Infinity, // or 30 * 24 * 60 * 60 * 1000
run: async () => { ... },
});

Repro with the same logic as executeWithTimeout, running a 200ms step:

  • timeout 60_000 -> "done"
  • timeout 2_592_000_000 (30 days) -> StepTimeoutError after 3ms
  • timeout Infinity -> StepTimeoutError after 1ms

Since timeouts aren't retried by default, the step is marked exhausted and the workflow fails.

Expected: the step waits for the full timeout (and Infinity means no timeout).

Fix idea: use the setLongTimeout helper from utils.ts (already used for the scheduler wait in index.ts), and treat a non-finite timeout as disabled like 0. Happy to send a PR with tests.

Lingua principale
Rust
Stelle
6.6k
Fork
304
Merge medio
19h 50m
PR unite (30g)
28

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 rivet-dev/rivet

Tutte le issue di rivet-dev/rivet

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.