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

Add support for custom socket factories #2151

Merged
merged 1 commit into from
Apr 14, 2020

Conversation

mina-asham
Copy link
Contributor

This can enable UDS (Unix Domain Socket) or any other custom address resolution

@mina-asham mina-asham force-pushed the socket-factory branch 5 times, most recently from 1ae2859 to d19ffdc Compare February 26, 2020 18:34
@mina-asham
Copy link
Contributor Author

@sazzad16 @gkorland can you have a look when you have time? This should unblock any custom connection

@sazzad16
Copy link
Collaborator

@mina-asham Please add a test or two. A test for UDS would be a great addition.

@mina-asham
Copy link
Contributor Author

@sazzad16 I didn't want to add another dependency per our discussion in #1942, but thinking about it now, I think it makes sense to add the dependency as a test dependency, so will do that and port my test from there!

@mina-asham mina-asham force-pushed the socket-factory branch 2 times, most recently from c3c3039 to 98e84c9 Compare February 28, 2020 09:05
@mina-asham
Copy link
Contributor Author

Test is failing because of spop test due to a fix in redis/unstable, see: #2152

@sazzad16
Copy link
Collaborator

Test is failing because of spop test due to a fix in redis/unstable

@mina-asham Don't worry about it. There are a couple of Redis commands that are in back-and-forth changes.

@sazzad16
Copy link
Collaborator

LGTM!

@mina-asham Not necessary, but can give a short explanation of change in SSLJedisClusterTest? (I'm just being lazy :P)

@sazzad16 sazzad16 added this to the 3.3.0 milestone Feb 28, 2020
@mina-asham
Copy link
Contributor Author

LGTM!

@mina-asham Not necessary, but can give a short explanation of change in SSLJedisClusterTest? (I'm just being lazy :P)

Ha, the main difference is that the previous code used to:

  • Create and assign the socket field
  • Then fail trying to wrap it in SSL (but at that point the socket field was already assigned, so the isConnected check would pass)

The new logic is all encapsulated in the factory, so you either get a socket or an exception, so the isConnected method would return false (which I believe is the right behavior), so the cluster failure is that there are no active nodes instead of trying to use a node it thinks is active but it's not

@sazzad16 sazzad16 requested a review from gkorland March 6, 2020 16:30
@mina-asham
Copy link
Contributor Author

@gkorland do you have any comments on this one?

@mina-asham mina-asham force-pushed the socket-factory branch 3 times, most recently from caea260 to 651e55a Compare March 10, 2020 15:58
…main Socket) or any other custom address resolution

- Related pull requests: redis#2036 and redis#1942 and redis#1132
@gkorland
Copy link
Contributor

@mina-asham it LGTM, but it's pretty hard to review the changes this way with the force-pushed. Next time please keep the incremental commits.

@mina-asham
Copy link
Contributor Author

@mina-asham it LGTM, but it's pretty hard to review the changes this way with the force-pushed. Next time please keep the incremental commits.

Will do, thanks for reviewing!

@mina-asham
Copy link
Contributor Author

Can we merge this one?

@sazzad16
Copy link
Collaborator

@mina-asham We will merge it, but there is a confusion about which version we'll be adding it in. That's all.

@gkorland
Copy link
Contributor

gkorland commented Apr 6, 2020

I think we are missing here a solution for the JedisPool & JedisCluster

@mina-asham
Copy link
Contributor Author

You're right, missed the respective constructors there, will add them and uodate this PR!

@sazzad16
Copy link
Collaborator

@gkorland I'm going ahead and merging this.
@mina-asham Please do further improvements in separate PR. Thanks for you contribution!

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

Successfully merging this pull request may close these issues.

3 participants