Revert "Adding locking around LoadFile in FileExternalAccountCredentials"

This reverts commit c51d063ff2.
pull/36071/head
Gregory Cooke 9 months ago
parent dbe19e6011
commit cc358fadce
  1. 6
      src/core/lib/security/credentials/external/file_external_account_credentials.cc
  2. 1
      src/core/lib/security/credentials/external/file_external_account_credentials.h

@ -102,11 +102,7 @@ void FileExternalAccountCredentials::RetrieveSubjectToken(
std::function<void(std::string, grpc_error_handle)> cb) {
// To retrieve the subject token, we read the file every time we make a
// request because it may have changed since the last request.
absl::StatusOr<Slice> content_slice;
{
grpc_core::MutexLock l(&m_);
content_slice = LoadFile(file_, /*add_null_terminator=*/false);
}
auto content_slice = LoadFile(file_, /*add_null_terminator=*/false);
if (!content_slice.ok()) {
cb("", content_slice.status());
return;

@ -52,7 +52,6 @@ class FileExternalAccountCredentials final : public ExternalAccountCredentials {
std::string file_;
std::string format_type_;
std::string format_subject_token_field_name_;
grpc_core::Mutex m_;
};
} // namespace grpc_core

Loading…
Cancel
Save