Explicit sidecar stops accepting VMs after ~2048 create then dispose cycles "SidecarEventBufferOverflow"

クローズ
#2,052 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

関連するプルリクエストがすでにマージされています。

  • #2065 @eersnington による — マージ済み

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
javascript, rust, wasm
領域
backend, devtools

調査の方向性

The reproduction uses AgentOs.createSidecar, AgentOs.create, and vm.dispose from @rivet-dev/agentos-core; begin by tracing how vm_lifecycle events are buffered and consumed, then check where SidecarEventBufferOverflow is exported. The report asks to discard lifecycle events nobody awaits and export the error type. Done means repeated create, evaluate, and dispose cycles no longer fill the buffer, and callers can import the error class.

索引モデルが issue の本文から書いたものです。

説明

Hi Rivet team,

A long-lived explicit sidecar stops working after about 2048 VMs. Each cycle is create → evaluate → dispose on the same sidecar. Run 2048 fails with SidecarEventBufferOverflow, and every later call on that sidecar fails the same way until it's replaced.

sidecar event buffer overflow after 4096 queued events (capacity 4096) while buffering vm_lifecycle

4096 events after 2048 VMs looks like two vm_lifecycle events per disposed VM staying in the buffer, but we haven't dug further.

Repro (0.4.1, Node 24, macOS):

import { AgentOs } from "@rivet-dev/agentos-core";

const sidecar = await AgentOs.createSidecar();
for (let run = 0; run < 2100; run++) {
    try {
        const vm = await AgentOs.create({ defaultSoftware: false, sidecar: { kind: "explicit", handle: sidecar } });
        await vm.javascript.evaluate("(async () => 1)()");
        await vm.dispose();
        console.log(`run ${run} success`);
    } catch (error) {
        console.log(`run ${run}`, error.name, error.message);
        break;
    }
}
run 2048: SidecarEventBufferOverflow sidecar event buffer overflow after 4096 queued events (capacity 4096) while buffering vm_lifecycle

For now we treat the overflow as a closed sidecar and start a new one. Two small things would help:

  • not keeping lifecycle events nobody waits for, so a long-lived sidecar doesn't fill up
  • exporting SidecarEventBufferOverflow from @rivet-dev/agentos-core, so we can check instanceof instead of error.name

Thanks a lot!

主要言語
Rust
スター
4.8k
フォーク
270
平均マージ
13時間 37分
マージ済み PR(30日)
48

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rivet-dev/agentos のほかの issue

rivet-dev/agentos の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。