Lock mutex before access to std::cerr in clickhouse-benchmark

This commit is contained in:
vdimir 2021-07-23 17:35:22 +03:00
parent d72cc7c7a8
commit d1106b325e
No known key found for this signature in database
GPG Key ID: F57B3E10A21DBB31

View File

@ -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,6 +382,7 @@ private:
}
catch (...)
{
std::lock_guard lock(mutex);
std::cerr << "An error occurred while processing the query '"
<< query << "'.\n";
if (!continue_on_errors)