effect: action on a missing actor instance fails as internal_error instead of actor.aborted
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 82/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- bun, typescript
調査の方向性
rivetkit-typescript/packages/effect/src/internal/ActionDispatcher.tsから始め、不足しているインスタンスの分岐を、既存の中断されたアクションの処理とあわせて調べてください。Issueには、ActionDispatcher.makeでgetInstanceがundefinedを返す決定論的なユニット再現手順があります。これを実行するか適宜調整して、エラーがactor.abortedであることを確認してください。説明にある対応するdist/internal/ActionDispatcher.jsを確認し、回帰ケースが成功することを確かめてください。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Rust
- スター
- 6.3k
- フォーク
- 279
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 53
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rivet-dev/rivet のほかの issue
-
Rust client drops connection-level errors when actionId is null (JSON/CBOR)対応中かも @DibbayajyotiRoy が 19 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
rivet-dev/rivet#5819 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Queue docs say completable messages are removed on receive, but they stay stored until complete()対応中かも @Saisharathchandranandnetha が 30 日前に担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 91/100
rivet-dev/rivet#5762 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Serverless listener forwards /start to the application when basePath is "/"対応中かも @Saisharathchandranandnetha が 32 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
rivet-dev/rivet#5755 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
rivet-dev/rivet#5909 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
rivet-dev/rivet#5908 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
rivet-dev/rivet の issue をすべて見る
似ている issue
-
documentation priority:p2 type:chore
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
-
dispatch:sol-high documentation
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
carrick-sh/carrick#768 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
correctness postgres tursopg
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
tursodatabase/turso#10442 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
ankitects/anki#5864 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
area: config effort: S good first issue P3 type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
ferenyl/azuredevopstui#63 ·