Skip to content

Add custom connection validation to ConnectionPoolSupport #3081 #3138

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

Merged
merged 2 commits into from
Apr 15, 2025

Conversation

big-cir
Copy link
Contributor

@big-cir big-cir commented Jan 23, 2025

Overview

  • Introduce Predicate for connection validation
  • Add new overload to ConnectionPoolSupport.createGenericObjectPool()
  • Implement ConnectionPoolConfig to encapsulate validation and wrapping options
  • Update RedisPooledObjectFactory to use custom validation logic

Closes #3081

@tishun
Copy link
Collaborator

tishun commented Feb 3, 2025

Hey @big-cir ,

did you try running mvn formatter:format?

@tishun tishun added the type: feature A new feature label Feb 3, 2025
@tishun tishun added this to the 6.6.0.RELEASE milestone Feb 3, 2025
@big-cir big-cir force-pushed the lettuce-connection-validation branch from e2fe8a1 to 11b8752 Compare February 3, 2025 08:38
@big-cir
Copy link
Contributor Author

big-cir commented Feb 3, 2025

@tishun
thanks :)
I tried running mvn formatter:format.

@big-cir big-cir force-pushed the lettuce-connection-validation branch from 11b8752 to 064d3f7 Compare February 4, 2025 16:17
@tishun tishun force-pushed the lettuce-connection-validation branch from 064d3f7 to f87dfcd Compare April 15, 2025 18:32
@tishun
Copy link
Collaborator

tishun commented Apr 15, 2025

Addressed a few things:

  • make sure we preserve the existing API contract by only extending it
  • no need for an additional ObjectFactory
  • (just in case) added the option for createSoftReferenceObjectPool too
  • added new unit tests, reverted the existing ones, to make sure we preserve the contract

@tishun
Copy link
Collaborator

tishun commented Apr 15, 2025

Thank you for the contribution!

@big-cir
Copy link
Contributor Author

big-cir commented Apr 15, 2025

Thank you for the detailed explanation of the changes.
I'm sorry i'm not able to help, but I'll try to do so in future contributions. :)

@tishun
Copy link
Collaborator

tishun commented Apr 15, 2025

Thank you for the detailed explanation of the changes. We're sorry we weren't able to help, but we'll try to do so in future contributions. :)

On the contrary, you helped a lot, you did most of the work! :)

It's sometimes faster and easier to do the final polishing myself.

@tishun tishun merged commit 966d8a9 into redis:main Apr 15, 2025
7 checks passed
@big-cir
Copy link
Contributor Author

big-cir commented Apr 15, 2025

Thank you so much for your kind words!

I appreciate your support and guidance throughout the process.

I'll keep doing my best in future contributions!🙇‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A new feature
Projects
None yet
2 participants