Skip to content

Commit

Permalink
fix random timeout issue for mpp execution (#1307) (#1318)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-srebot authored Dec 29, 2020
1 parent f2761fe commit f4700d1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions dbms/src/DataStreams/CreatingSetsBlockInputStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,14 @@ void CreatingSetsBlockInputStream::createOne(SubqueryForSet & subquery)
}
}

if (join_build_thread_pool != nullptr)
join_build_thread_pool->wait();

if (subquery.join)
subquery.join->setFinishBuildTable(true);

if (table_out)
table_out->writeSuffix();
if (join_build_thread_pool != nullptr)
join_build_thread_pool->wait();

watch.stop();

Expand Down
1 change: 1 addition & 0 deletions dbms/src/Flash/Mpp/ExchangeReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ void ExchangeReceiver::ReadLoop(const String & meta_raw)
meet_error = true;
err = Exception("fatal error");
}
std::lock_guard<std::mutex> lock(mu);
live_connections--;
cv.notify_all();
LOG_DEBUG(log, "read thread end!!! live connections: " << std::to_string(live_connections));
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Flash/Mpp/ExchangeReceiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ExchangeReceiver
std::mutex mu;
std::condition_variable cv;
std::queue<Block> block_buffer;
std::atomic_int live_connections;
Int32 live_connections;
bool inited;
bool meet_error;
Exception err;
Expand Down

0 comments on commit f4700d1

Please sign in to comment.