Skip to content

Commit d072615

Browse files
committed
fix(core): bound the checkpoint cancel request with a timeout
1 parent 7aae3bf commit d072615

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/core/src/v3/serverOnly/checkpointClient.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export type CheckpointClientOptions = {
1313
orchestrator: CheckpointType;
1414
};
1515

16+
const CANCEL_TIMEOUT_MS = 5_000;
17+
1618
export class CheckpointClient {
1719
private readonly logger = new SimpleStructuredLogger("checkpoint-client");
1820

@@ -170,7 +172,7 @@ export class CheckpointClient {
170172
}): Promise<"ok" | "unsupported" | "failed"> {
171173
const res = await fetch(
172174
new URL(`/api/v1/runs/${runFriendlyId}/checkpoints/cancel`, this.opts.apiUrl),
173-
{ method: "POST" }
175+
{ method: "POST", signal: AbortSignal.timeout(CANCEL_TIMEOUT_MS) }
174176
);
175177

176178
if (res.status === 404) {

0 commit comments

Comments
 (0)