[JAVA-4993] MongoClient leak where AutoEncryptionSettings#keyVaultMongoClientSettings is non-null and AutoEncryptionSettings#isBypassAutoEncryption is false Created: 30/May/23 Updated: 28/Oct/23 Resolved: 12/Jun/23 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Client Side Encryption |
| Affects Version/s: | None |
| Fix Version/s: | 4.10.0 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Jeffrey Yemin | Assignee: | Jeffrey Yemin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Documentation Changes: | Not Needed | ||||
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
||||
| Description |
|
Looks like in com.mongodb.client.internal.Crypts#createCrypt, and possibly the reactive version of that method, leaks a MongoClient in the case where AutoEncryptionSettings#keyVaultMongoClientSettings is non-null and AutoEncryptionSettings#isBypassAutoEncryption is false. In this case, two MongoClient instances are created (it's not clear why), and only internalClient is closed by com.mongodb.client.internal.Crypt |
| Comments |
| Comment by Githook User [ 12/Jun/23 ] |
|
Author: {'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}Message: Fix MongoClient leak in auto-encryption (#1142) When AutoEncryptionSettings#keyVaultMongoClientSettings is non-null and The bug is fixed in both the synchronous and reactive streams drivers.
|
| Comment by Jeffrey Yemin [ 30/May/23 ] |
|
Confirmed via manual testing with tour.ClientSideEncryptionAutoEncryptionSettingsTour that there is indeed a MongoClient leak. |