Repository: hbase Updated Branches: refs/heads/HBASE-14850 e5643e863 -> e2a1cad3e
HBASE-18565 [C++] Fix deadlock in AsyncScanRetryingCaller and other RPCs Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/e2a1cad3 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/e2a1cad3 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/e2a1cad3 Branch: refs/heads/HBASE-14850 Commit: e2a1cad3e3b8e75c3569eda07d20c18155549009 Parents: e5643e8 Author: Enis Soztutar <e...@apache.org> Authored: Fri Aug 11 12:23:43 2017 -0700 Committer: Enis Soztutar <e...@apache.org> Committed: Fri Aug 11 12:23:43 2017 -0700 ---------------------------------------------------------------------- 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(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/e2a1cad3/hbase-native-client/core/async-rpc-retrying-caller.cc ---------------------------------------------------------------------- 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))); }); } http://git-wip-us.apache.org/repos/asf/hbase/blob/e2a1cad3/hbase-native-client/core/async-scan-rpc-retrying-caller.cc ---------------------------------------------------------------------- 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());