diff --git a/src/database/graph_db.cpp b/src/database/graph_db.cpp index aa01ef2e3..29847c254 100644 --- a/src/database/graph_db.cpp +++ b/src/database/graph_db.cpp @@ -43,7 +43,8 @@ GraphDb::GraphDb(const std::string &name, const fs::path &snapshot_db_dir) if (FLAGS_query_execution_time_sec != -1) { transaction_killer_.Run( - std::chrono::seconds(std::max(1, FLAGS_query_execution_time_sec / 4)), + std::chrono::seconds( + std::max(1, std::min(5, FLAGS_query_execution_time_sec / 4))), [this]() { tx_engine_.ForEachActiveTransaction([](tx::Transaction &t) { if (t.creation_time() + diff --git a/src/query/exceptions.hpp b/src/query/exceptions.hpp index de81da0ab..05848a2b8 100644 --- a/src/query/exceptions.hpp +++ b/src/query/exceptions.hpp @@ -63,13 +63,16 @@ class TypeMismatchError : public SemanticException { class HintedAbortError : public QueryException { public: using QueryException::QueryException; - HintedAbortError() : QueryException("") {} + HintedAbortError() + : QueryException( + "Transaction was asked to abort, most likely because it was " + "executing longer than time specified by " + "--query-execution-time-sec flag") {} }; class UnprovidedParameterError : public QueryException { public: using QueryException::QueryException; - UnprovidedParameterError() : QueryException("") {} }; /**