mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Fix hang at shutdown in clickhouse-local
This commit is contained in:
parent
f2cb271425
commit
79a38c4c6e
@ -273,11 +273,12 @@ try
|
|||||||
global_context->setCurrentDatabase(default_database);
|
global_context->setCurrentDatabase(default_database);
|
||||||
applyCmdOptions(*global_context);
|
applyCmdOptions(*global_context);
|
||||||
|
|
||||||
String path = global_context->getPath();
|
if (config().has("path"))
|
||||||
if (!path.empty())
|
|
||||||
{
|
{
|
||||||
|
String path = global_context->getPath();
|
||||||
|
|
||||||
/// Lock path directory before read
|
/// 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);
|
LOG_DEBUG(log, "Loading metadata from {}", path);
|
||||||
Poco::File(path + "data/").createDirectories();
|
Poco::File(path + "data/").createDirectories();
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
100 14
|
10
tests/queries/0_stateless/01647_clickhouse_local_hung.sh
Executable file
10
tests/queries/0_stateless/01647_clickhouse_local_hung.sh
Executable 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
|
Loading…
Reference in New Issue
Block a user