Skip to content

fix(rivetkit): retry connection open after depot.unavailable - #5959

Open
kunalgoesbyken wants to merge 3 commits into
rivet-dev:mainfrom
kunalgoesbyken:fix/client-retry-depot-unavailable
Open

kunalgoesbyken wants to merge 3 commits into
rivet-dev:mainfrom
kunalgoesbyken:fix/client-retry-depot-unavailable

Conversation

@kunalgoesbyken

Copy link
Copy Markdown

Description

Fixes #5953.

  • depot.unavailable is now classified like depot.request_deadline_exceeded: a reconnect signal, not a request retry. A connection that hits it while the engine's storage is starting retries the open instead of going idle for good.
  • Stateless requests are still not replayed on this error, since the engine reports that the command's outcome may be unknown.
  • Actions called while the open keeps failing behave as they do for every other retryable open error. Each one stays queued with its promise pending, and is sent once after the reopen. A queued action was never sent, so it can't have run already. Every path that rejects a pending action (#rejectPendingPromises, the get_params_failed path, dispose) also clears the queue first, so an action a caller saw fail never runs later.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

vitest run tests/lifecycle-errors.test.ts in rivetkit-typescript/packages/rivetkit:

  • The classification test, and a test where the driver's first openWebSocket throws depot.unavailable. Before the change the connection goes idle; after it, the connection opens again.
  • An action called during the failed open stays pending and unsent until the reopened socket gets Init, then is sent exactly once.
  • biome check on the changed files.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rivetkit client: ActorConn treats depot.unavailable on connection open as terminal, a retained connection never reconnects

1 participant