effect: action on a missing actor instance fails as internal_error instead of actor.aborted
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
- Ambito
- backend, distributed-systems
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
- 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 rivet-dev/rivet
-
Rust client drops connection-level errors when actionId is null (JSON/CBOR)Forse già presa @DibbayajyotiRoy l’ha presa 18 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
rivet-dev/rivet#5819 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Queue docs say completable messages are removed on receive, but they stay stored until complete()Forse già presa @Saisharathchandranandnetha l’ha presa 28 giorni fa. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 91/100
rivet-dev/rivet#5762 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Serverless listener forwards /start to the application when basePath is "/"Forse già presa @Saisharathchandranandnetha l’ha presa 31 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
rivet-dev/rivet#5755 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
rivet-dev/rivet#5894 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
rivet-dev/rivet#5881 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di rivet-dev/rivet
Issue simili
-
meta.json, text.txt and try JSON are written non-atomicallyForse già presa @qwertymuzaffar l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
qwertymuzaffar/parrot#47 ·
I maintainer di solito rispondono entro 1 giorno
-
Alt select PhotocraftApertapriority: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
storytold/photocraft#8041 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
fmt -p: an unprefixed last line without a newline gets one addedForse già presa @fixfon l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
jhspetersson/fselect#187 ·
-
documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
writerslogic/holographic-memory#96 ·
I maintainer di solito rispondono entro 1 giorno