Skip to content

Commit f3105c7

Browse files
committed
fix(runner): fix http requests not returning 503 when actor removed (#3322)
1 parent 716db37 commit f3105c7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

engine/sdks/typescript/runner/src/tunnel.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,12 @@ export class Tunnel {
214214
msg: "ignoring request for unknown actor",
215215
actorId,
216216
});
217-
return new Response("Actor not found", { status: 404 });
217+
218+
// NOTE: This is a special response that will cause Guard to retry the request
219+
//
220+
// See should_retry_request_inner
221+
// https://github.com/rivet-dev/rivet/blob/222dae87e3efccaffa2b503de40ecf8afd4e31eb/engine/packages/guard-core/src/proxy_service.rs#L2458
222+
return new Response("Actor not found", { status: 503, headers: { "x-rivet-error": "runner.actor_not_found" } });
218223
}
219224

220225
const fetchHandler = this.#runner.config.fetch(

0 commit comments

Comments
 (0)