Skip to content

Commit 62c9a5b

Browse files
committed
Fix restoring after waiting for task/batch
1 parent f339b41 commit 62c9a5b

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

.changeset/tidy-dryers-sleep.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"trigger.dev": patch
3+
"@trigger.dev/core": patch
4+
---
5+
6+
Fixes an issue that caused failed tasks when resuming after calling `triggerAndWait` or `batchTriggerAndWait` in prod/staging (this doesn't effect dev).
7+
8+
The version of Node.js we use for deployed workers (latest 20) would crash with an out-of-memory error when the checkpoint was restored. This crash does not happen on Node 18x or Node21x, so we've decided to upgrade the worker version to Node.js21x, to mitigate this issue.
9+
10+
You'll need to re-deploy to production to fix the issue.

packages/cli-v3/src/Containerfile.prod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:20-bookworm-slim@sha256:d4cdfc305abe5ea78da7167bf78263c22596dc332f2654b662890777ea166224 AS base
1+
FROM node:21-bookworm-slim@sha256:fb82287cf66ca32d854c05f54251fca8b572149163f154248df7e800003c90b5 AS base
22

33
ENV DEBIAN_FRONTEND=noninteractive
44
RUN apt-get update && apt-get install -y --no-install-recommends \

packages/core/src/v3/runtime/prodRuntimeManager.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ export class ProdRuntimeManager implements RuntimeManager {
9595
friendlyId: params.id,
9696
});
9797

98-
return await promise;
98+
const result = await promise;
99+
100+
clock.reset();
101+
102+
return result;
99103
}
100104

101105
async waitForBatch(params: {
@@ -122,6 +126,8 @@ export class ProdRuntimeManager implements RuntimeManager {
122126

123127
const results = await promise;
124128

129+
clock.reset();
130+
125131
return {
126132
id: params.id,
127133
items: results,

0 commit comments

Comments
 (0)