Skip to content

Passing AbortSignal to exec() throws across DO RPC #764

Description

@ghostwriternr

Version

@cloudflare/sandbox@0.12.1

Summary

ExecOptions accepts signal?: AbortSignal, but passing one to getSandbox(...).exec(command, { signal }) throws before the command runs:

DataCloneError: AbortSignal serialization is not enabled.

The options object is structured-cloned across the Worker→DO RPC boundary, and AbortSignal isn't cloneable, so the call fails rather than the signal being honored or ignored.

Repro

From a Worker with a Sandbox binding:

const sandbox = getSandbox(env.Sandbox, 'repro');
const controller = new AbortController();
await sandbox.exec('echo hi', { signal: controller.signal });
// -> DataCloneError: AbortSignal serialization is not enabled.

Expected

Passing signal shouldn't throw — either it cancels the command or it's a documented no-op on this path.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions