Skip to content

Commit 8d06fa4

Browse files
author
Bryan Donlan
committed
Remove the KMS client cache
1 parent b5282ce commit 8d06fa4

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 1.3.4
4+
5+
### Minor Changes
6+
7+
* Removed the KMS client cache, which could result in a memory leak when
8+
decrypting certain malformed ciphertexts. This may reduce performance slightly
9+
in some scenarios.
10+
311
## 1.3.3
412

513
### Minor Changes

src/main/java/com/amazonaws/encryptionsdk/kms/KmsMasterKeyProvider.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,10 @@ private RegionalClientSupplier clientFactory() {
259259
AWSKMSClientBuilder builder = templateBuilder_ != null ? cloneClientBuilder(templateBuilder_)
260260
: AWSKMSClientBuilder.standard();
261261

262-
ConcurrentHashMap<String, AWSKMS> clientCache = new ConcurrentHashMap<>();
263-
264-
return region -> clientCache.computeIfAbsent(region, region2 -> {
262+
return region -> {
265263
// Clone yet again as we're going to change the region field.
266-
return cloneClientBuilder(builder).withRegion(region2).build();
267-
});
264+
return cloneClientBuilder(builder).withRegion(region).build();
265+
};
268266
}
269267
}
270268

0 commit comments

Comments
 (0)