Skip to content

Commit 40f4c25

Browse files
authored
Merge branch 'main' into docs/community-packages
2 parents 0d5e1f5 + 31a4327 commit 40f4c25

File tree

16 files changed

+613
-152
lines changed

16 files changed

+613
-152
lines changed

.changeset/wise-mirrors-hug.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/core": patch
3+
---
4+
5+
Add manual checkpoint schema

.changeset/witty-jars-approve.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@trigger.dev/core": patch
3+
---
4+
5+
- Add new run completion submission message with ack
6+
- Add timeout support to sendWithAck

apps/coordinator/Containerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
1313
FROM node-20 AS base
1414

1515
RUN apt-get update \
16-
&& apt-get install -y buildah ca-certificates dumb-init docker.io \
16+
&& apt-get install -y buildah ca-certificates dumb-init docker.io busybox \
1717
&& rm -rf /var/lib/apt/lists/*
1818

1919
COPY --chown=node:node .gitignore .gitignore

apps/coordinator/src/checkpointer.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,14 @@ export class Checkpointer {
415415
const buildah = new Buildah({ id: `${runId}-${shortCode}`, abortSignal: controller.signal });
416416
const crictl = new Crictl({ id: `${runId}-${shortCode}`, abortSignal: controller.signal });
417417

418+
const removeCurrentAbortController = () => {
419+
// Ensure only the current controller is removed
420+
if (this.#abortControllers.get(runId) === controller) {
421+
this.#abortControllers.delete(runId);
422+
}
423+
controller.signal.removeEventListener("abort", onAbort);
424+
};
425+
418426
const cleanup = async () => {
419427
const metadata = {
420428
runId,
@@ -424,6 +432,7 @@ export class Checkpointer {
424432

425433
if (this.#dockerMode) {
426434
this.#logger.debug("Skipping cleanup in docker mode", metadata);
435+
removeCurrentAbortController();
427436
return;
428437
}
429438

@@ -436,11 +445,7 @@ export class Checkpointer {
436445
this.#logger.error("Error during cleanup", { ...metadata, error });
437446
}
438447

439-
// Ensure only the current controller is removed
440-
if (this.#abortControllers.get(runId) === controller) {
441-
this.#abortControllers.delete(runId);
442-
}
443-
controller.signal.removeEventListener("abort", onAbort);
448+
removeCurrentAbortController();
444449
};
445450

446451
try {

0 commit comments

Comments
 (0)