Skip to content

Commit

Permalink
cancel tasks when 3rd retry failed
Browse files Browse the repository at this point in the history
  • Loading branch information
juliaElastic committed Dec 7, 2022
1 parent 98412f7 commit 692df8e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions x-pack/plugins/fleet/server/services/agents/action_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ export abstract class ActionRunner {
if (this.retryParams.retryCount === 3) {
const errorMessage = 'Stopping after 3rd retry. Error: ' + error.message;
appContextService.getLogger().warn(errorMessage);

// no need for check task, action failed
this.bulkActionsResolver!.removeIfExists(this.checkTaskId!);

// do not keep rertrying
this.bulkActionsResolver!.removeIfExists(this.retryParams.taskId!);

return;
}
} else {
Expand Down

0 comments on commit 692df8e

Please sign in to comment.