pitrou commented on code in PR #44990:
URL: https://github.com/apache/arrow/pull/44990#discussion_r1889906123


##########
cpp/src/parquet/encryption/internal_file_decryptor.cc:
##########
@@ -147,13 +141,10 @@ std::shared_ptr<Decryptor> 
InternalFileDecryptor::GetFooterDecryptor(
   std::shared_ptr<encryption::AesDecryptor> aes_metadata_decryptor;
   std::shared_ptr<encryption::AesDecryptor> aes_data_decryptor;
 
-  {
-    std::lock_guard<std::mutex> lock(mutex_);
-    aes_metadata_decryptor = encryption::AesDecryptor::Make(
-        algorithm_, key_len, /*metadata=*/true, &all_decryptors_);
-    aes_data_decryptor = encryption::AesDecryptor::Make(
-        algorithm_, key_len, /*metadata=*/false, &all_decryptors_);
-  }
+  aes_metadata_decryptor =
+      encryption::AesDecryptor::Make(algorithm_, key_len, /*metadata=*/true);
+  aes_data_decryptor =
+      encryption::AesDecryptor::Make(algorithm_, key_len, /*metadata=*/false);

Review Comment:
   I still don't think this function is correct, because it still caches the 
decryptors. It's the footer key that should be cached in 
`InternalFileDecryptor`, not the decryptors themselves.
   
   (also, please let's reuse `GetFooterKey` instead of duplicating its code)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to