This is an automated email from the ASF dual-hosted git repository. zghao pushed a commit to branch HBASE-14850 in repository https://gitbox.apache.org/repos/asf/hbase.git
commit bbdac8ebeff0e704e9d0c788dad7ba87a071bf53 Author: Enis Soztutar <[email protected]> AuthorDate: Fri Aug 11 12:23:43 2017 -0700 HBASE-18565 [C++] Fix deadlock in AsyncScanRetryingCaller and other RPCs --- hbase-native-client/core/async-rpc-retrying-caller.cc | 4 ++-- hbase-native-client/core/async-scan-rpc-retrying-caller.cc | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hbase-native-client/core/async-rpc-retrying-caller.cc b/hbase-native-client/core/async-rpc-retrying-caller.cc index cb058b1..8e60991 100644 --- a/hbase-native-client/core/async-rpc-retrying-caller.cc +++ b/hbase-native-client/core/async-rpc-retrying-caller.cc @@ -148,9 +148,9 @@ void AsyncSingleRequestRpcRetryingCaller<RESP>::OnError( * establishment time (see ConnectionFactory::Connect()), otherwise, the IOThreadPool thread * just hangs because it deadlocks itself. */ - conn_->retry_executor()->add([&]() { + conn_->retry_executor()->add([=]() { retry_timer_->scheduleTimeoutFn( - [this]() { conn_->cpu_executor()->add([&]() { LocateThenCall(); }); }, + [=]() { conn_->cpu_executor()->add([&]() { LocateThenCall(); }); }, std::chrono::milliseconds(TimeUtil::ToMillis(delay_ns))); }); } diff --git a/hbase-native-client/core/async-scan-rpc-retrying-caller.cc b/hbase-native-client/core/async-scan-rpc-retrying-caller.cc index fbdf17a..a1e8362 100644 --- a/hbase-native-client/core/async-scan-rpc-retrying-caller.cc +++ b/hbase-native-client/core/async-scan-rpc-retrying-caller.cc @@ -406,6 +406,7 @@ void AsyncScanRpcRetryingCaller::Call() { ->AsyncCall(region_location_->server_name().host_name(), region_location_->server_name().port(), std::move(req), security::User::defaultUser(), "ClientService") + .via(conn_->cpu_executor().get()) .then([self, this](const std::unique_ptr<Response>& resp) { auto scan_resp = std::static_pointer_cast<pb::ScanResponse>(resp->resp_msg()); return OnComplete(controller_, scan_resp, resp->cell_scanner());
