MetadataCredentialsPluginWrapper: Create thread pool only if needed (#27791)

Non-blocking metadata credentials plugins do not use a thread pool.
pull/27806/head
Jürg Billeter 3 years ago committed by GitHub
parent 188cee5e5c
commit b85ca5d5ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/cpp/client/secure_credentials.cc

@ -524,6 +524,10 @@ void MetadataCredentialsPluginWrapper::InvokePlugin(
MetadataCredentialsPluginWrapper::MetadataCredentialsPluginWrapper(
std::unique_ptr<MetadataCredentialsPlugin> plugin)
: thread_pool_(CreateDefaultThreadPool()), plugin_(std::move(plugin)) {}
: plugin_(std::move(plugin)) {
if (plugin_->IsBlocking()) {
thread_pool_.reset(CreateDefaultThreadPool());
}
}
} // namespace grpc

Loading…
Cancel
Save