Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task Manager: Don't refresh after SO updates #99919

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion x-pack/plugins/actions/server/actions_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ export class ActionsClient {
})
);

return await this.unsecuredSavedObjectsClient.delete('action', id);
return await this.unsecuredSavedObjectsClient.delete('action', id, { refresh: false });
}

public async execute({
Expand Down
5 changes: 4 additions & 1 deletion x-pack/plugins/actions/server/create_execute_function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ export function createExecutionEnqueuerFunction({
params,
apiKey,
},
executionSourceAsSavedObjectReferences(source)
{
...executionSourceAsSavedObjectReferences(source),
refresh: false,
}
);

await taskManager.schedule({
Expand Down
7 changes: 3 additions & 4 deletions x-pack/plugins/actions/server/lib/task_runner_factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,9 @@ export class TaskRunnerFactory {
// We would idealy secure every operation but in order to support clean up of legacy alerts
// we allow this operation in an unsecured manner
// Once support for legacy alert RBAC is dropped, this can be secured
await getUnsecuredSavedObjectsClient(fakeRequest).delete(
ACTION_TASK_PARAMS_SAVED_OBJECT_TYPE,
actionTaskParamsId
);
await getUnsecuredSavedObjectsClient(
fakeRequest
).delete(ACTION_TASK_PARAMS_SAVED_OBJECT_TYPE, actionTaskParamsId, { refresh: false });
} catch (e) {
// Log error only, we shouldn't fail the task because of an error here (if ever there's retry logic)
logger.error(
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/task_manager/server/task_store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export class TaskStore {
*/
public async remove(id: string): Promise<void> {
try {
await this.savedObjectsRepository.delete('task', id);
await this.savedObjectsRepository.delete('task', id, { refresh: false });
} catch (e) {
this.errors$.next(e);
throw e;
Expand Down