From 3a0ef9c562a551c13d20212dd8c94d630cf1dde0 Mon Sep 17 00:00:00 2001 From: ivanmorozov Date: Sat, 14 Oct 2023 19:22:48 +0300 Subject: [PATCH] KIKIMR-19704: add validation for prevent repeateble execution task --- ydb/core/tx/conveyor/usage/abstract.cpp | 3 +++ ydb/core/tx/conveyor/usage/abstract.h | 1 + 2 files changed, 4 insertions(+) diff --git a/ydb/core/tx/conveyor/usage/abstract.cpp b/ydb/core/tx/conveyor/usage/abstract.cpp index 44c048350106..629fcd4646f7 100644 --- a/ydb/core/tx/conveyor/usage/abstract.cpp +++ b/ydb/core/tx/conveyor/usage/abstract.cpp @@ -1,10 +1,13 @@ #include "abstract.h" #include +#include #include #include namespace NKikimr::NConveyor { bool ITask::Execute(std::shared_ptr signals) { + AFL_VERIFY(!ExecutedFlag); + ExecutedFlag = true; bool result = false; const TMonotonic start = TMonotonic::Now(); try { diff --git a/ydb/core/tx/conveyor/usage/abstract.h b/ydb/core/tx/conveyor/usage/abstract.h index a3f8f13138fa..237dbad792be 100644 --- a/ydb/core/tx/conveyor/usage/abstract.h +++ b/ydb/core/tx/conveyor/usage/abstract.h @@ -40,6 +40,7 @@ class ITask { YDB_READONLY_DEF(TString, ErrorMessage); YDB_ACCESSOR(EPriority, Priority, EPriority::Normal); YDB_READONLY_DEF(std::optional, OwnerId); + bool ExecutedFlag = false; protected: ITask& SetErrorMessage(const TString& message) { ErrorMessage = message;