fix(NODE-2995): Add shared metadata MongoClient #2760
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Automatic client side encryption needs to perform metadata look ups
like listCollections. In situations where the connection pool size
is constrained or in full use it can be impossible for an operation
to proceed. Adding a separate client in these situations permits the
metadata look ups to proceed unblocking operations.
What changed?
I added a class to encapsulate the functionality of managing the internal client. We can discuss the details of how we want to manage this, for example if we feel the new class if overkill we can go to keeping things saved directly on the MongoClient. I made the prose tests somewhat programatic, but I still wanted them to be relatively easily debugged so there's some repetition in the design, of course sound off if we want this cleaner.
Are there any files to ignore?
A spec test sync is included here, you can filter out the json and yaml files. An important note I synced with the tests written at the time of the meta client spec work since there's been changes since then relating to AWS temporary credentials. Just calling it out if you notice it doesn't match exactly.