Skip to content

Commit f525bac

Browse files
committed
fix(run-engine): stop the batch timeout error claiming a received-item count
The message reported successfulRunCount plus failedRunCount as "items received", but those track runs created and are only written when a batch completes. An aborted batch never completes, so the field is unset and the message read "0 of N items were received" no matter how many items arrived. It now states only the expected count, which is set at creation and always accurate.
1 parent 2bf591f commit f525bac

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

internal-packages/run-engine/src/engine/systems/batchSystem.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,12 @@ export class BatchSystem {
133133
return;
134134
}
135135

136-
const enqueuedCount = (batch.successfulRunCount ?? 0) + (batch.failedRunCount ?? 0);
137136
const error: TaskRunError = {
138137
type: "STRING_ERROR",
139138
raw:
140-
`Batch ${batch.friendlyId} was never fully created: only ${enqueuedCount} of ` +
141-
`${batch.expectedCount} items were received before it timed out, so it can never ` +
142-
`complete. batchTriggerAndWait failed rather than waiting forever.`,
139+
`Batch ${batch.friendlyId} was never fully created: its ${batch.expectedCount} ` +
140+
`items could not be streamed before it timed out, so the batch can never complete. ` +
141+
`batchTriggerAndWait failed rather than waiting forever.`,
143142
};
144143

145144
await this.waitpointSystem.completeWaitpoint({
@@ -152,7 +151,6 @@ export class BatchSystem {
152151
this.$.logger.warn("expireBatch: aborted an unsealed batch and resumed its parent", {
153152
batchId,
154153
waitpointId: waitpoint.id,
155-
enqueuedCount,
156154
expectedCount: batch.expectedCount,
157155
});
158156
});

0 commit comments

Comments
 (0)