Fix hang at shutdown in clickhouse-local

This commit is contained in:
Alexey Milovidov 2021-01-10 06:35:05 +03:00
parent f2cb271425
commit 79a38c4c6e
3 changed files with 15 additions and 3 deletions

View File

@ -273,11 +273,12 @@ try
global_context->setCurrentDatabase(default_database);
applyCmdOptions(*global_context);
String path = global_context->getPath();
if (!path.empty())
if (config().has("path"))
{
String path = global_context->getPath();
/// Lock path directory before read
status.emplace(global_context->getPath() + "status", StatusFile::write_full_info);
status.emplace(path + "status", StatusFile::write_full_info);
LOG_DEBUG(log, "Loading metadata from {}", path);
Poco::File(path + "data/").createDirectories();

View File

@ -0,0 +1 @@
100 14

View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -e
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
for _ in {1..100}; do echo 'Hello, world!' | ${CLICKHOUSE_LOCAL} --query "SELECT * FROM table" --structure 's String' | wc -c; done | uniq -c