-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Description
Expected behavior
I have my Jedis client configured to connect to localhost.
I expect the connection to be made to the localhost via loopback.
Actual behavior
As of the changes in #1342, when specifying a localhost address, it now resolves to my machine's network ip address.
This makes it impossible to connect to a redis-sentinel on localhost because the sentinel only allows connections from loopback on more recent versions of Redis.
Steps to reproduce:
- Initialize a Jedis 2.9.+ client with the host
'localhost' - Unable to connect to local redis-sentinel (version 3.2.2) because
'localhost'resolved to an external ip (i.e.10.1.10.254).
I think the new behavior in getLocalHostQuietly() introduces system-dependent behavior via InetAddress.getLocalHost().getHostAddress(), which does not seem to be the intent of the code.
Redis / Jedis Configuration
Jedis version:
2.9.x (since #1342)
Redis version:
3.2.2
Java version:
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
zbstof, hungvnvnext, dylankolson and bhonnegowda
Metadata
Metadata
Assignees
Labels
No labels