rivet-dev / rivet-dev/actors

fix(envoy-client): bound the shared WebSocket writer queue

Open
#5,468 1 comment 0 reactions 1 assignee View on GitHub

@MasterPtato is already working on this.

Since Aug 13, 2026.

Dominant language
Rust
Stars
6.1k
Forks
250
Avg merge
2d 8h
Merged PRs (30d)
96

Description

Problem

The native and WASM envoy-client transports feed the single actor-to-engine WebSocket writer through an unbounded mpsc channel. If producers outpace the socket, queued protocol messages can grow without bound.

This is a shared transport issue, not specific to SSE. The queue carries HTTP request/response chunks alongside WebSocket traffic, events, SQLite, and other envoy messages, so an SSE-only limit would leave the generic failure mode in place.

Desired behavior

  • Bound queued writer memory across all message types.
  • Apply backpressure or fail fast without blocking an actor's serialized event loop.
  • Preserve control-message progress and disconnect/reconnect semantics.
  • Define fair accounting for differently sized messages; a message-count-only bound is insufficient.
  • Add saturation tests for native and WASM transports, including HTTP streaming, WebSockets, events, and SQLite.
  • Add queue-depth/queued-byte and overload metrics.

Relevant code

  • engine/sdks/rust/envoy-client/src/connection/native.rs
  • engine/sdks/rust/envoy-client/src/connection/wasm.rs
  • engine/sdks/rust/envoy-client/src/connection/mod.rs

Discovered while reviewing the HTTP/SSE streaming change.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.