From cc358fadce7cf565e11cfe19eb1bcb60aa2126c1 Mon Sep 17 00:00:00 2001 From: Gregory Cooke Date: Fri, 8 Mar 2024 16:12:51 +0000 Subject: [PATCH] Revert "Adding locking around LoadFile in FileExternalAccountCredentials" This reverts commit c51d063ff28b0fd8c4c330e01255e8dc3a045867. --- .../external/file_external_account_credentials.cc | 6 +----- .../external/file_external_account_credentials.h | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/core/lib/security/credentials/external/file_external_account_credentials.cc b/src/core/lib/security/credentials/external/file_external_account_credentials.cc index 6f0fddd0546..6ae3c5a7198 100644 --- a/src/core/lib/security/credentials/external/file_external_account_credentials.cc +++ b/src/core/lib/security/credentials/external/file_external_account_credentials.cc @@ -102,11 +102,7 @@ void FileExternalAccountCredentials::RetrieveSubjectToken( std::function 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 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; diff --git a/src/core/lib/security/credentials/external/file_external_account_credentials.h b/src/core/lib/security/credentials/external/file_external_account_credentials.h index 3bbf82898bf..c8cf12177bd 100644 --- a/src/core/lib/security/credentials/external/file_external_account_credentials.h +++ b/src/core/lib/security/credentials/external/file_external_account_credentials.h @@ -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