This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch branch-3.0-preview
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0-preview by this
push:
new f710608c010 Pick "[bugfix](Cloud) Offer sync vault task to thread pool
to prevent bthread context switch #34951" (#34952)
f710608c010 is described below
commit f710608c01078492e6ea27bc808c8e340b838f55
Author: AlexYue <[email protected]>
AuthorDate: Thu May 16 15:39:38 2024 +0800
Pick "[bugfix](Cloud) Offer sync vault task to thread pool to prevent
bthread context switch #34951" (#34952)
---
be/src/cloud/cloud_internal_service.cpp | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/be/src/cloud/cloud_internal_service.cpp
b/be/src/cloud/cloud_internal_service.cpp
index aba178bb34d..782e6e317b1 100644
--- a/be/src/cloud/cloud_internal_service.cpp
+++ b/be/src/cloud/cloud_internal_service.cpp
@@ -31,7 +31,18 @@ void
CloudInternalServiceImpl::alter_vault_sync(google::protobuf::RpcController*
PAlterVaultSyncResponse*
response,
google::protobuf::Closure*
done) {
LOG(INFO) << "alter be to sync vault info from Meta Service";
- _engine.sync_storage_vault();
+ // If the vaults containing hdfs vault then it would try to create hdfs
connection using jni
+ // which would acuiqre one thread local jniEnv. But bthread context can't
guarantee that the brpc
+ // worker thread wouldn't do bthread switch between worker threads.
+ bool ret = _heavy_work_pool.try_offer([&]() {
+ brpc::ClosureGuard closure_guard(done);
+ _engine.sync_storage_vault();
+ });
+ if (!ret) {
+ brpc::ClosureGuard closure_guard(done);
+ LOG(WARNING) << "fail to offer alter_vault_sync request to the work
pool, pool="
+ << _heavy_work_pool.get_info();
+ }
}
} // namespace doris
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]