Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ This is a Rust workspace-based monorepo for Rivet. Key packages and components:
- **Shared Libraries** (`shared/{language}/{package}/`) - Libraries shared between the engine and rivetkit (e.g., `shared/typescript/virtual-websocket/`)
- **Service Infrastructure** - Distributed services communicate via NATS messaging with service discovery

### Engine Runner Parity
- Keep `engine/sdks/typescript/runner` and `engine/sdks/rust/engine-runner` at feature parity.
- Any behavior, protocol handling, or test coverage added to one runner should be mirrored in the other runner in the same change whenever possible.
- When parity cannot be completed in the same change, explicitly document the gap and add a follow-up task.

### Important Patterns

**Error Handling**
Expand Down
13 changes: 13 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions engine/packages/engine/tests/actors_alarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ impl AlarmAndSleepActor {
}

#[async_trait]
impl TestActor for AlarmAndSleepActor {
impl Actor for AlarmAndSleepActor {
async fn on_start(&mut self, config: ActorConfig) -> anyhow::Result<ActorStartResult> {
let generation = config.generation;
tracing::info!(?config.actor_id, generation, "alarm actor starting");
Expand Down Expand Up @@ -195,7 +195,7 @@ impl AlarmAndSleepOnceActor {
}

#[async_trait]
impl TestActor for AlarmAndSleepOnceActor {
impl Actor for AlarmAndSleepOnceActor {
async fn on_start(&mut self, config: ActorConfig) -> anyhow::Result<ActorStartResult> {
let generation = config.generation;
tracing::info!(?config.actor_id, generation, "alarm once actor starting");
Expand Down Expand Up @@ -250,7 +250,7 @@ impl AlarmSleepThenClearActor {
}

#[async_trait]
impl TestActor for AlarmSleepThenClearActor {
impl Actor for AlarmSleepThenClearActor {
async fn on_start(&mut self, config: ActorConfig) -> anyhow::Result<ActorStartResult> {
let generation = config.generation;
tracing::info!(?config.actor_id, generation, "alarm actor starting");
Expand Down Expand Up @@ -311,7 +311,7 @@ impl AlarmSleepThenReplaceActor {
}

#[async_trait]
impl TestActor for AlarmSleepThenReplaceActor {
impl Actor for AlarmSleepThenReplaceActor {
async fn on_start(&mut self, config: ActorConfig) -> anyhow::Result<ActorStartResult> {
let generation = config.generation;
tracing::info!(?config.actor_id, generation, "alarm actor starting");
Expand Down Expand Up @@ -374,7 +374,7 @@ impl MultipleAlarmSetActor {
}

#[async_trait]
impl TestActor for MultipleAlarmSetActor {
impl Actor for MultipleAlarmSetActor {
async fn on_start(&mut self, config: ActorConfig) -> anyhow::Result<ActorStartResult> {
let generation = config.generation;
tracing::info!(?config.actor_id, generation, "multi alarm actor starting");
Expand Down Expand Up @@ -429,7 +429,7 @@ impl MultiCycleAlarmActor {
}

#[async_trait]
impl TestActor for MultiCycleAlarmActor {
impl Actor for MultiCycleAlarmActor {
async fn on_start(&mut self, config: ActorConfig) -> anyhow::Result<ActorStartResult> {
let generation = config.generation;
tracing::info!(?config.actor_id, generation, "multi cycle alarm actor starting");
Expand Down Expand Up @@ -481,7 +481,7 @@ impl AlarmOnceActor {
}

#[async_trait]
impl TestActor for AlarmOnceActor {
impl Actor for AlarmOnceActor {
async fn on_start(&mut self, config: ActorConfig) -> anyhow::Result<ActorStartResult> {
let generation = config.generation;
tracing::info!(?config.actor_id, generation, "alarm once actor starting");
Expand Down Expand Up @@ -536,7 +536,7 @@ impl AlarmSleepThenCrashActor {
}

#[async_trait]
impl TestActor for AlarmSleepThenCrashActor {
impl Actor for AlarmSleepThenCrashActor {
async fn on_start(&mut self, config: ActorConfig) -> anyhow::Result<ActorStartResult> {
let generation = config.generation;
tracing::info!(?config.actor_id, generation, "alarm crash actor starting");
Expand Down Expand Up @@ -599,7 +599,7 @@ impl RapidAlarmCycleActor {
}

#[async_trait]
impl TestActor for RapidAlarmCycleActor {
impl Actor for RapidAlarmCycleActor {
async fn on_start(&mut self, config: ActorConfig) -> anyhow::Result<ActorStartResult> {
let generation = config.generation;
tracing::info!(?config.actor_id, generation, "rapid alarm cycle actor starting");
Expand Down Expand Up @@ -647,7 +647,7 @@ impl SetClearAlarmAndSleepActor {
}

#[async_trait]
impl TestActor for SetClearAlarmAndSleepActor {
impl Actor for SetClearAlarmAndSleepActor {
async fn on_start(&mut self, config: ActorConfig) -> anyhow::Result<ActorStartResult> {
let generation = config.generation;
tracing::info!(?config.actor_id, generation, "alarm actor starting");
Expand Down
16 changes: 8 additions & 8 deletions engine/packages/engine/tests/actors_kv_crud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl PutAndGetActor {
}

#[async_trait]
impl TestActor for PutAndGetActor {
impl Actor for PutAndGetActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "put and get actor starting");

Expand Down Expand Up @@ -116,7 +116,7 @@ impl GetNonexistentKeyActor {
}

#[async_trait]
impl TestActor for GetNonexistentKeyActor {
impl Actor for GetNonexistentKeyActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "get nonexistent key actor starting");

Expand Down Expand Up @@ -191,7 +191,7 @@ impl PutOverwriteActor {
}

#[async_trait]
impl TestActor for PutOverwriteActor {
impl Actor for PutOverwriteActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "put overwrite actor starting");

Expand Down Expand Up @@ -295,7 +295,7 @@ impl DeleteKeyActor {
}

#[async_trait]
impl TestActor for DeleteKeyActor {
impl Actor for DeleteKeyActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "delete key actor starting");

Expand Down Expand Up @@ -383,7 +383,7 @@ impl DeleteNonexistentKeyActor {
}

#[async_trait]
impl TestActor for DeleteNonexistentKeyActor {
impl Actor for DeleteNonexistentKeyActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "delete nonexistent key actor starting");

Expand Down Expand Up @@ -638,7 +638,7 @@ impl BatchPutActor {
}

#[async_trait]
impl TestActor for BatchPutActor {
impl Actor for BatchPutActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "batch put actor starting");

Expand Down Expand Up @@ -721,7 +721,7 @@ impl BatchGetActor {
}

#[async_trait]
impl TestActor for BatchGetActor {
impl Actor for BatchGetActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "batch get actor starting");

Expand Down Expand Up @@ -808,7 +808,7 @@ impl BatchDeleteActor {
}

#[async_trait]
impl TestActor for BatchDeleteActor {
impl Actor for BatchDeleteActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "batch delete actor starting");

Expand Down
4 changes: 2 additions & 2 deletions engine/packages/engine/tests/actors_kv_drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl DropClearsAllActor {
}

#[async_trait]
impl TestActor for DropClearsAllActor {
impl Actor for DropClearsAllActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "drop clears all actor starting");

Expand Down Expand Up @@ -137,7 +137,7 @@ impl DropEmptyActor {
}

#[async_trait]
impl TestActor for DropEmptyActor {
impl Actor for DropEmptyActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "drop empty actor starting");

Expand Down
16 changes: 8 additions & 8 deletions engine/packages/engine/tests/actors_kv_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl ListAllEmptyActor {
}

#[async_trait]
impl TestActor for ListAllEmptyActor {
impl Actor for ListAllEmptyActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "list all empty actor starting");

Expand Down Expand Up @@ -102,7 +102,7 @@ impl ListAllKeysActor {
}

#[async_trait]
impl TestActor for ListAllKeysActor {
impl Actor for ListAllKeysActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "list all keys actor starting");

Expand Down Expand Up @@ -199,7 +199,7 @@ impl ListAllLimitActor {
}

#[async_trait]
impl TestActor for ListAllLimitActor {
impl Actor for ListAllLimitActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "list all limit actor starting");

Expand Down Expand Up @@ -277,7 +277,7 @@ impl ListAllReverseActor {
}

#[async_trait]
impl TestActor for ListAllReverseActor {
impl Actor for ListAllReverseActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "list all reverse actor starting");

Expand Down Expand Up @@ -368,7 +368,7 @@ impl ListRangeInclusiveActor {
}

#[async_trait]
impl TestActor for ListRangeInclusiveActor {
impl Actor for ListRangeInclusiveActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "list range inclusive actor starting");

Expand Down Expand Up @@ -467,7 +467,7 @@ impl ListRangeExclusiveActor {
}

#[async_trait]
impl TestActor for ListRangeExclusiveActor {
impl Actor for ListRangeExclusiveActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "list range exclusive actor starting");

Expand Down Expand Up @@ -566,7 +566,7 @@ impl ListPrefixActor {
}

#[async_trait]
impl TestActor for ListPrefixActor {
impl Actor for ListPrefixActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "list prefix actor starting");

Expand Down Expand Up @@ -669,7 +669,7 @@ impl ListPrefixNoMatchActor {
}

#[async_trait]
impl TestActor for ListPrefixNoMatchActor {
impl Actor for ListPrefixNoMatchActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "list prefix no match actor starting");

Expand Down
14 changes: 7 additions & 7 deletions engine/packages/engine/tests/actors_kv_misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl BinaryDataActor {
}

#[async_trait]
impl TestActor for BinaryDataActor {
impl Actor for BinaryDataActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "binary data actor starting");

Expand Down Expand Up @@ -114,7 +114,7 @@ impl EmptyValueActor {
}

#[async_trait]
impl TestActor for EmptyValueActor {
impl Actor for EmptyValueActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "empty value actor starting");

Expand Down Expand Up @@ -203,7 +203,7 @@ impl LargeValueActor {
}

#[async_trait]
impl TestActor for LargeValueActor {
impl Actor for LargeValueActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "large value actor starting");

Expand Down Expand Up @@ -286,7 +286,7 @@ impl GetEmptyKeysActor {
}

#[async_trait]
impl TestActor for GetEmptyKeysActor {
impl Actor for GetEmptyKeysActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "get empty keys actor starting");

Expand Down Expand Up @@ -350,7 +350,7 @@ impl ListLimitZeroActor {
}

#[async_trait]
impl TestActor for ListLimitZeroActor {
impl Actor for ListLimitZeroActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "list limit zero actor starting");

Expand Down Expand Up @@ -429,7 +429,7 @@ impl KeyOrderingActor {
}

#[async_trait]
impl TestActor for KeyOrderingActor {
impl Actor for KeyOrderingActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "key ordering actor starting");

Expand Down Expand Up @@ -520,7 +520,7 @@ impl ManyKeysActor {
}

#[async_trait]
impl TestActor for ManyKeysActor {
impl Actor for ManyKeysActor {
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "many keys actor starting");

Expand Down
6 changes: 3 additions & 3 deletions engine/packages/engine/tests/actors_lifecycle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fn actor_basic_create() {
"runner should have the actor allocated"
);

tracing::info!(?actor_id, runner_id = ?runner.runner_id, "actor allocated to runner");
tracing::info!(?actor_id, "actor allocated to runner");
});
}

Expand Down Expand Up @@ -406,7 +406,7 @@ fn actor_explicit_destroy() {
actor_id: actor_id.parse().expect("failed to parse actor_id"),
},
common::api_types::actors::delete::DeleteQuery {
namespace: Some(namespace.clone()),
namespace: namespace.clone(),
},
)
.await
Expand Down Expand Up @@ -1143,7 +1143,7 @@ fn runner_at_max_capacity() {
actor_id: actor_ids[0].parse().unwrap(),
},
common::api_types::actors::delete::DeleteQuery {
namespace: Some(namespace.clone()),
namespace: namespace.clone(),
},
)
.await
Expand Down
Loading
Loading