feat(rust/engine-runner): feature parity with typescript#4289
feat(rust/engine-runner): feature parity with typescript#4289NathanFlurry wants to merge 1 commit intomainfrom
Conversation
|
🚅 Deployed to the rivet-pr-4289 environment in rivet-frontend
|
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR Review: feat(rust/engine-runner): feature parity with typescriptThis is a substantial and well-structured PR that transforms the Rust engine runner from a pure test harness into a production-capable SDK mirroring the TypeScript runner. The reconnect loop, tunnel protocol support, serverless mode, Axum-based actor routing, and e2e test suite are all significant improvements. Notes below are organized by severity. Issues1. Unbounded body collection in Axum handler ( let body = axum::body::to_bytes(body, usize::MAX)
.await
.context("failed to collect actor response body")?;Using 2. Race condition in serverless start handler ( if !runner.runner.inner.started.load(Ordering::SeqCst) {
runner.runner.start().await.map_err(internal_error)?;
}Two concurrent SSE connections can both observe 3. let client = reqwest::Client::new();CLAUDE.md says to use 4. Empty string as "no namespace" is non-idiomatic ( // Before
namespace: None
// After
namespace: "".to_string()Using an empty string to signal "no namespace" is not idiomatic Rust— 5. Indentation inconsistency in test files In Nits / Suggestions6. fn clone_for_handle(&self) -> RunnerInner {
self.clone()
}This just calls 7. Retry on HTTP 400 in test helper Ok(response) if response.status() == reqwest::StatusCode::BAD_REQUEST => {
tokio::time::sleep(Duration::from_millis(250)).await;
drop(response);
continue;
}400 Bad Request usually indicates a permanent client error; retrying it will mask bugs and make tests flaky. If this is intended to handle a specific transient case (e.g., actor not yet routable), the condition should be narrower (e.g., inspect a specific error body field). 8. The Rust runner is not 9. Duplicate builder entry points Both 10. pub async fn wait_ready(&self) -> Result<String> {
loop {
if let Some(runner_id) = self.inner.runner_id.lock().await.clone() {
return Ok(runner_id);
}
self.inner.ready_notify.notified().await;
}
}If the Positive observations
|
20e4fd0 to
0c4e446
Compare

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: