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

workflow-runtime 0.0.3: sweep() never recovers a run whose worker died mid-step (fixed on main by #15, unreleased)

Aperta
#23 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
15/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
github, node.js, typescript
Ambito
backend, release

Direzione di ricerca

This asks for release PR #16 to publish core 0.0.5 and runtime 0.0.4; the fix is already merged in #15 and verified on main. Read #16 for the release status and project release instructions, then check whether the requested versions have shipped to npm. Done means both published packages include the fix so users can pin released versions.

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

Descrizione

Versions

@tanstack/workflow-core 0.0.4, @tanstack/workflow-runtime 0.0.3 (latest on npm)

Describe the bug and the steps to reproduce it

If the process driving a run dies inside a step, the run stays running with an expired lease forever. In 0.0.3, runtime.sweep() only handles schedules and timers and never calls store.claimStaleRuns. Calling claimStaleRuns plus runWorkflow by hand doesn't help either, because core 0.0.4 has no recover mode, so replay stops at the last checkpoint.

#15 (merged 2026-07-21) fixes this: expired-run recovery in sweep(), recover: true in core, and lease heartbeats. I built main at b928717 and confirmed sweep() re-runs the interrupted step and finishes the run, and that the heartbeat stops a long step from being reclaimed mid-flight.

Request: could the release PR #16 be merged, so core 0.0.5 and runtime 0.0.4 ship to npm? That would let us pin a published version instead of a git SHA.

Your Minimal, Reproducible Example
import { createWorkflow } from '@tanstack/workflow-core'
import { defineWorkflowRuntime, inMemoryWorkflowExecutionStore } from '@tanstack/workflow-runtime'

const wf = createWorkflow({ id: 'wf', version: 'v1' }).handler(async (ctx) => {
  await ctx.step('a', async () => 1)
  return 'done'
})
const store = inMemoryWorkflowExecutionStore()
const runtime = defineWorkflowRuntime({ store, workflows: { wf: { load: async () => wf } }, defaultLeaseMs: 50 })

await store.createRun({ runId: 'r1', workflowId: 'wf', workflowVersion: 'v1', input: {}, now: Date.now() })
await store.claimRun({ runId: 'r1', leaseOwner: 'dead-worker', leaseMs: 50, now: Date.now() }) // worker dies here
await new Promise((r) => setTimeout(r, 100))

const sweep = await runtime.sweep()
console.log(sweep.summary, (await store.loadRun('r1'))?.status)
// 0.0.3: { scheduled: {}, timers: {}, eventCount: 0 } 'running'  (expected: recovered, then finished)
Do you intend to try to help solve this bug with your own PR?

No — the fix is already on main; this is a request to publish it.

Terms & Code of Conduct
  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
Lingua principale
TypeScript
Stelle
221
Fork
10
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

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

Tutte le issue di TanStack/workflow

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.