Skip to content

Commit 19ebee6

Browse files
committed
improve runtime manager debug logs
1 parent 13afaa2 commit 19ebee6

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

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

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,10 @@ export class ManagedRuntimeManager implements RuntimeManager {
2727
private ipc: ExecutorToWorkerProcessConnection,
2828
private showLogs: boolean
2929
) {
30-
setTimeout(() => {
31-
this.log("Runtime status", {
32-
resolversbyWaitId: this.resolversByWaitId.keys(),
33-
resolversByWaitpoint: this.resolversByWaitpoint.keys(),
34-
});
35-
}, 1000);
30+
// Log out the runtime status on a long interval to help debug stuck executions
31+
setInterval(() => {
32+
this.log("[DEBUG] ManagedRuntimeManager status", this.status);
33+
}, 300_000);
3634
}
3735

3836
disable(): void {
@@ -178,14 +176,14 @@ export class ManagedRuntimeManager implements RuntimeManager {
178176
}
179177

180178
if (!waitId) {
181-
this.log("No waitId found for waitpoint", waitpoint);
179+
this.log("No waitId found for waitpoint", { ...this.status, ...waitpoint });
182180
return;
183181
}
184182

185183
const resolve = this.resolversByWaitId.get(waitId);
186184

187185
if (!resolve) {
188-
this.log("No resolver found for waitId", waitId);
186+
this.log("No resolver found for waitId", { ...this.status, waitId });
189187
return;
190188
}
191189

@@ -227,4 +225,11 @@ export class ManagedRuntimeManager implements RuntimeManager {
227225
if (!this.showLogs) return;
228226
console.log(`[${new Date().toISOString()}] ${message}`, args);
229227
}
228+
229+
private get status() {
230+
return {
231+
resolversbyWaitId: Array.from(this.resolversByWaitId.keys()),
232+
resolversByWaitpoint: Array.from(this.resolversByWaitpoint.keys()),
233+
};
234+
}
230235
}

0 commit comments

Comments
 (0)