Repository navigation
fix(effect): reject actions on a torn-down instance with actor.aborted - #5916
Open
kunalgoesbyken wants to merge 1 commit into
Open
kunalgoesbyken wants to merge 1 commit into
kunalgoesbyken wants to merge 1 commit into
Conversation
An action can reach the dispatcher after onSleep or onDestroy has removed the actor instance but before the request's abort signal fires. That path threw a plain Error, which core sanitized into rivetkit.internal_error, so clients that retry on actor.aborted gave up. Treat a missing instance as the same lifecycle exit as an interrupted action fiber. Fixes rivet-dev#5891
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #5891.
@rivetkit/effectafteronSleeporonDestroyhas removed the actor instance, but before the request's abort signal fires, now rejects withactor.abortedinstead of a plainError("actor instance missing").rivetkit.internal_error(HTTP 500), so clients that retry onactor.abortedrecover across graceful worker restarts.Type of change
How Has This Been Tested?
vitest run src/internal/ActionDispatcher.test.ts: the live-signal case fails onmain(expected Error: actor instance missing to be an instance of RivetError) and passes with this change.vitest run src --typecheck: no type errors. Every suite passes exceptRegistry.test.ts, which needs the native NAPI addon I did not build locally and fails the same way onmain.test/e2e.test.tsneeds a localrivet-enginebuild and was left to CI.tsc --noEmitinrivetkit-typescript/packages/effectpasses.biome checkpasses on the changed files.Checklist: