Skip to content

Bound Sandbox terminate with a cleanup budget - #45

Merged
jacobprall merged 1 commit into
mainfrom
terminate-cleanup-budget
Oct 28, 2026
Merged

jacobprall merged 1 commit into
mainfrom
terminate-cleanup-budget

Conversation

@jacobprall

Copy link
Copy Markdown
Collaborator

The SDK's terminate takes no signal, so a hung terminate request in a finally block could hold an answer that's already computed. SandboxClient.terminate now races the call against a 10-second cleanupTimeoutMs budget, retries included. Past that, the Sandbox's provider-side timeout is the backstop, and terminateQuietly logs the failure as before.

This is the small, safe part of #26. The rest (connect-token requests that ignore the caller's signal) should be fixed in the SDK instead of a custom transport in this template. It's tracked in render-oss/sdk#31, and #26 stays open until we upgrade.

Refs #26.

Made with Cursor

The SDK's terminate takes no signal, so a hung request could hold an answer
that's already computed. Race it against a 10-second budget; past that, the
Sandbox's provider-side timeout is the backstop. Signal support for terminate
and connect-token requests is requested upstream in render-oss/sdk#31.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jacobprall
jacobprall merged commit c3126c1 into main Oct 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant