Description
Currently, the RetryingExecutionStrategy handles retries silently. The main TaskRunner only emits taskStart and taskEnd. Users have no visibility into whether a task is succeeding on the first try or failing and retrying, which is crucial for debugging flaky services.
Proposed Solution
- Add a
taskRetry event to RunnerEventPayloads in RunnerEvents.ts.
taskRetry: {
step: TaskStep<TContext>;
attempt: number;
error: any;
};
- Update
RetryingExecutionStrategy so it accepts the EventBus (or a callback) to emit this event when a retry is triggered.
Alternatives Considered
Passing a custom logger to the strategy, but an event-driven approach is more consistent with the rest of the library.
Description
Currently, the
RetryingExecutionStrategyhandles retries silently. The mainTaskRunneronly emitstaskStartandtaskEnd. Users have no visibility into whether a task is succeeding on the first try or failing and retrying, which is crucial for debugging flaky services.Proposed Solution
taskRetryevent toRunnerEventPayloadsinRunnerEvents.ts.RetryingExecutionStrategyso it accepts theEventBus(or a callback) to emit this event when a retry is triggered.Alternatives Considered
Passing a custom logger to the strategy, but an event-driven approach is more consistent with the rest of the library.