diff --git a/programs/benchmark/Benchmark.cpp b/programs/benchmark/Benchmark.cpp index 859222c236e..f0c1c239a6e 100644 --- a/programs/benchmark/Benchmark.cpp +++ b/programs/benchmark/Benchmark.cpp @@ -271,7 +271,8 @@ private: if (max_time > 0 && total_watch.elapsedSeconds() >= max_time) { - std::cout << "Stopping launch of queries. Requested time limit is exhausted.\n"; + std::cout << "Stopping launch of queries." + << " Requested time limit " << max_time << " seconds is exhausted.\n"; return false; } @@ -368,8 +369,7 @@ private: { extracted = queue.tryPop(query, 100); - if (shutdown - || (max_iterations && queries_executed == max_iterations)) + if (shutdown || (max_iterations && queries_executed == max_iterations)) { return; } @@ -382,8 +382,9 @@ private: } catch (...) { - std::cerr << "An error occurred while processing the query '" - << query << "'.\n"; + std::lock_guard lock(mutex); + std::cerr << "An error occurred while processing the query " << "'" << query << "'" + << ": " << getCurrentExceptionMessage(false) << std::endl; if (!continue_on_errors) { shutdown = true;