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

Incorrect parsing of host name in getHostAndPortFromNodeLine() #526

Closed
mateuszlitwin opened this issue Feb 5, 2014 · 3 comments
Closed
Milestone

Comments

@mateuszlitwin
Copy link

When asking one of the cluster nodes for other nodes (e.g. node at 127.0.0.1:6379), redis might return row like this:
5524e3bbf68ea876459f21eea65c856eac25028e :0 myself,master - 0 0 0 connected 0-5460

This node is indexed with String ":0" intead of e.g. "127.0.0.1:6379".
That is why node "127.0.0.1:6379" will be duplicated in 'Map<String, JedisPool> nodes' in JedisClusterConnectionHandler class.

I am pretty sure it is not expected behaviour. Using guava's HostAndPort intead of String or custom HostAndPort would much safer.

@marcosnils
Copy link
Contributor

@divath we don't like to use third party libraries in Jedis as we want to keep it as simple and lightweight as possible.

We'll address this parsing issue ASAP.

@marcosnils
Copy link
Contributor

I've found how @antirez handles it:
addr = n[:host]+":"+n[:port].to_s if addr == ":0"
where n is the current node.

@xetorthio
Copy link
Contributor

Perfect. Lets fix it and release 2.3.1 asap :)
On Feb 4, 2014 7:34 PM, "Marcos Nils" [email protected] wrote:

I've found how @antirez https://github.com/antirez handles it:
addr = n[:host]+":"+n[:port].to_s if addr == ":0"
where n is the current node.

Reply to this email directly or view it on GitHubhttps://github.com//issues/526#issuecomment-34125520
.

@xetorthio xetorthio added this to the 2.3.1 milestone Feb 5, 2014
xetorthio added a commit that referenced this issue Feb 5, 2014
Fix #526. Node parsing error uppon :0
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

No branches or pull requests

3 participants