Avoid hanging clickhouse-benchmark if connection fails (i.e. on EMFILE)

This commit is contained in:
Azat Khuzhin 2021-07-21 09:29:28 +03:00
parent 2796aa333f
commit 3f0dd40c69
3 changed files with 14 additions and 0 deletions

View File

@ -313,6 +313,7 @@ private:
}
catch (...)
{
shutdown = true;
pool.wait();
throw;
}

View File

@ -0,0 +1,3 @@
Loaded 1 queries.
I/O error: Too many open files
70

View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
# shellcheck disable=SC2086
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
# Limit number of files to 50, and we will get EMFILE for some of socket()
prlimit --nofile=50 $CLICKHOUSE_BENCHMARK --iterations 1 --concurrency 50 --query 'select 1' 2>&1
echo $?