Add message to HintedAbortError

Reviewers: mferencevic

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D868
This commit is contained in:
Mislav Bradac 2017-10-06 14:39:11 +02:00
parent 4c25123d83
commit c3a211fd4e
2 changed files with 7 additions and 3 deletions

View File

@ -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() +

View File

@ -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("") {}
};
/**