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

effect: action on a missing actor instance fails as internal_error instead of actor.aborted

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

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
bun, typescript

Direzione di ricerca

Inizia da rivetkit-typescript/packages/effect/src/internal/ActionDispatcher.ts e ispeziona il ramo dell’istanza mancante insieme alla gestione esistente delle azioni interrotte. L’issue fornisce una riproduzione unitaria deterministica che usa ActionDispatcher.make con getInstance che restituisce undefined; eseguila o adattala per verificare che l’errore sia actor.aborted. Controlla il dist/internal/ActionDispatcher.js corrispondente, come descritto, e conferma che il caso di regressione passi.

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

Descrizione

Summary

In @rivetkit/effect (2.3.25 through 2.3.27, and main at the time of writing), an action that reaches a worker after the actor's instance has been removed, but before the request's abort signal has fired, fails with a plain Error("actor instance missing"). The core then returns it to the client as rivetkit.internal_error (HTTP 500) instead of actor.aborted.

rivetkit-typescript/packages/effect/src/internal/ActionDispatcher.ts:

const instance = getInstance(c.actorId);
if (!instance) {
  if (c.abortSignal.aborted) throw makeActorAbortedError();
  throw new Error("actor instance missing");
}

The same dispatcher already maps interrupted actions to actor.aborted ("Surface those lifecycle exits as RivetKit's structured action-aborted error instead of an internal error"). The missing-instance branch is the same lifecycle exit, seen slightly earlier.

How it shows up

During a graceful worker stop, an HTTP action can arrive in that window. We captured it with the dispatcher instrumented: the action found no instance and c.abortSignal.aborted was false, 53 ms after native shutdown began. The core then logged:

level=warn message="actor framework action error response" … group=rivetkit code=internal_error

A client that retries on actor.aborted (waiting for the actor to be ready again) cannot distinguish this from a genuine internal failure, so it gives up. In our tests it happened in roughly 1 of 20 to 1 of 80 graceful worker restarts with a live reader.

Reproduction (deterministic, unit level)

import { dirname, join } from "node:path";
import { Action, Actor } from "@rivetkit/effect";

// the dispatcher is internal; load it next to the package entry (exports "./src/mod.ts")
const ActionDispatcher = await import(join(dirname(Bun.resolveSync("@rivetkit/effect", import.meta.dir)), "internal/ActionDispatcher.ts"));
const Ping = Action.make("Ping");
const handlers = ActionDispatcher.make({ actor: Actor.make("Probe", { actions: [Ping] }), getInstance: () => undefined });
await handlers.Ping({ actorId: "probe", abortSignal: new AbortController().signal }, undefined);
// rejects with Error("actor instance missing"); expected RivetError actor.aborted

Suggested fix

Treat a missing instance as a lifecycle abort regardless of the signal:

if (!instance) throw makeActorAbortedError();

(and the same in dist/internal/ActionDispatcher.js). We run this as a local patch and the failure no longer occurs.

Lingua principale
Rust
Stelle
6.3k
Fork
279
Merge medio
1g 13h
PR unite (30g)
42

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 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.