Skip to content
Merged
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
8 changes: 8 additions & 0 deletions .changeset/execute-one-hour.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@executor-js/runtime-dynamic-worker": patch
"@executor-js/runtime-quickjs": patch
"@executor-js/runtime-deno-subprocess": patch
"@executor-js/runtime-workerd-subprocess": patch
---

Code run through `execute` now has sixty minutes by default before it is stopped, up from five, so a script that waits on a long job (polling a machine run, a long upstream call) finishes in one call. A caller can still pass a shorter `timeoutMs`.
2 changes: 1 addition & 1 deletion apps/host-selfhost/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export interface SelfHostConfig {
readonly orgSlug: string;
/**
* Sandbox execution budget passed to the QuickJS runtime, or undefined for
* the runtime's own default (5 minutes). An operator knob in principle, but
* the runtime's own default (60 minutes). An operator knob in principle, but
* its real consumer is the e2e harness, which shrinks it to seconds so the
* sandbox-deadline scenario proves its race without waiting out real
* minutes (the same pattern as MCP_PAUSED_SESSION_IDLE_TIMEOUT_MS on cloud).
Expand Down
2 changes: 1 addition & 1 deletion packages/kernel/runtime-deno-subprocess/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export type DenoSubprocessExecutorOptions = {
};

const IPC_PREFIX = "@@executor-ipc@@";
const DEFAULT_TIMEOUT_MS = 5 * 60_000;
const DEFAULT_TIMEOUT_MS = 60 * 60_000;

// ---------------------------------------------------------------------------
// Errors
Expand Down
4 changes: 2 additions & 2 deletions packages/kernel/runtime-dynamic-worker/src/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class DynamicWorkerExecutionError extends Data.TaggedError("DynamicWorker
export type DynamicWorkerExecutorOptions = {
readonly loader: WorkerLoader;
/**
* Timeout in milliseconds for code execution. Defaults to 5 minutes.
* Timeout in milliseconds for code execution. Defaults to 60 minutes.
*/
readonly timeoutMs?: number;
/**
Expand Down Expand Up @@ -103,7 +103,7 @@ type WorkerRpcResponse = WorkerRpcSuccess | WorkerRpcFailure;
// Constants
// ---------------------------------------------------------------------------

const DEFAULT_TIMEOUT_MS = 5 * 60_000;
const DEFAULT_TIMEOUT_MS = 60 * 60_000;
/**
* Extra wall-clock the host waits beyond the effective in-sandbox timeout
* before declaring the isolate wedged. The in-sandbox timer should always fire
Expand Down
10 changes: 5 additions & 5 deletions packages/kernel/runtime-quickjs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ const engine = createExecutionEngine({

### Options

| Option | Default | Description |
| ------------------- | ---------- | --------------------------------- |
| `timeoutMs` | `300_000` | Max wall-clock time per execution |
| `memoryLimitBytes` | `64 * 1MB` | Max memory the VM can allocate |
| `maxStackSizeBytes` | `1 * 1MB` | Max call-stack depth |
| Option | Default | Description |
| ------------------- | ----------- | --------------------------------- |
| `timeoutMs` | `3_600_000` | Max wall-clock time per execution |
| `memoryLimitBytes` | `64 * 1MB` | Max memory the VM can allocate |
| `maxStackSizeBytes` | `1 * 1MB` | Max call-stack depth |

### Swapping the QuickJS build

Expand Down
6 changes: 3 additions & 3 deletions packages/kernel/runtime-quickjs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ class QuickJsExecutionError extends Data.TaggedError("QuickJsExecutionError")<{
readonly message: string;
}> {}

// Large OpenAPI specs can take longer to parse inside QuickJS, so keep the
// default execution budget at five minutes unless a caller opts into less.
const DEFAULT_TIMEOUT_MS = 5 * 60_000;
// Long jobs (polling a machine run, parsing a large OpenAPI spec) need room,
// so the default execution budget is sixty minutes unless a caller opts into less.
const DEFAULT_TIMEOUT_MS = 60 * 60_000;
const DEFAULT_MEMORY_LIMIT_BYTES = 64 * 1024 * 1024;
const DEFAULT_MAX_STACK_SIZE_BYTES = 1 * 1024 * 1024;
const EXECUTION_FILENAME = "executor-quickjs-runtime.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/kernel/runtime-workerd-subprocess/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import * as Effect from "effect/Effect";

export const WORKERD_VERSION = "1.20260708.1";

const DEFAULT_TIMEOUT_MS = 5 * 60_000;
const DEFAULT_TIMEOUT_MS = 60 * 60_000;
const DEFAULT_HOST_TIMEOUT_GRACE_MS = 30_000;
export class WorkerdSubprocessError extends Data.TaggedError("WorkerdSubprocessError")<{
readonly message: string;
Expand Down
Loading