Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MongoClientCache for factories with same/equal configurations #112

Merged
merged 1 commit into from Apr 3, 2024

Conversation

zaza
Copy link
Contributor

@zaza zaza commented Mar 22, 2024

MongoDriverInformation does not implement hashCode/equals which effectively prevents DefaultMongoClientFactory from being used as a key in MongoClientCache i.e. even for the same configuration factories are never equal and create multiple, redundant cache entries.

…uals

MongoDriverInformation does not implement hashCode/equals which effectively prevents DefaultMongoClientFactory from being used as a key in MongoClientCache i.e. even for the same configuration factories are never equal and create multiple, redundant cache entries.
@stp-pv
Copy link

stp-pv commented Mar 22, 2024

I would also consider implementing equals() and hashCode() for SimpleMongoConfig to avoid surprises.

@zaza
Copy link
Contributor Author

zaza commented Mar 22, 2024

I would also consider implementing equals() and hashCode() for SimpleMongoConfig to avoid surprises.

I did that here but can join both PRs it that makes sense.

@zaza
Copy link
Contributor Author

zaza commented Mar 26, 2024

@rozza would joining both PRs help with getting this reviewed and (hopefully) merged soon?

@rozza rozza merged commit 757229d into mongodb:main Apr 3, 2024
11 of 14 checks passed
@zaza zaza deleted the fix-mongo-client-cache branch April 3, 2024 12:50
rozza added a commit to rozza/mongo-spark that referenced this pull request Apr 3, 2024
@rozza
Copy link
Member

rozza commented Apr 3, 2024

Thank you @zaza this has been merged into main 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants