[TRI-1996] A failed run isn't resuming properly from the UI
matt-aitken opened this issue · comments
When you "Rerun" job from the UI you get given two options IF the run has failed.
"Run again" works as designed, it creates a new run with the same payload.
But "Retry Job run" should continue the run and retry failed tasks.
To reproduce
- Run this job, it will fail where the error is thrown.
client.defineJob({
id: "test",
name: "test error handling",
version: "0.0.1",
trigger: eventTrigger({
name: "test.event",
}),
run: async (payload, io, ctx) => {
const result = await io.runTask("todo", async (client) => {
throw new Error("I'm broken");
await io.logger.info("I fixed it");
});
await io.logger.info("Afterwards");
},
});
- Modify the code by commenting out the thrown error.
- Press the "Retry Job run" button in the UI.
- Notice that the run fails again with the error cached.
What might be happening?
- Check that errors are not being cached in
runTask
. Only successful results should be. - Check that the
ContinueRunService
is working correctly.