Skip to content

Commit

Permalink
Lock whole query due to POCO can not run in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
auxten committed Jun 24, 2024
1 parent c1ad28d commit 62626e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions programs/local/LocalChdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ local_result_v2 * queryToBuffer(
// Add path string
argv.push_back("--path=" + path);
}
// argv.push_back("--no-system-tables");
// Add query string
argv.push_back("--query=" + queryStr);

Expand Down
4 changes: 4 additions & 0 deletions programs/local/LocalServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1050,10 +1050,14 @@ class query_result_
};


// global mutex for all local servers
static std::mutex CHDB_MUTEX;

std::unique_ptr<query_result_> pyEntryClickHouseLocal(int argc, char ** argv)
{
try
{
std::lock_guard<std::mutex> lock(CHDB_MUTEX);
DB::LocalServer app;
app.init(argc, argv);
int ret = app.run();
Expand Down

0 comments on commit 62626e9

Please sign in to comment.