Skip to content
New issue

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

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

Already on GitHub? # to your account

Clear cached InetSocketAddress on reconnect. #59

Merged
merged 1 commit into from
Oct 15, 2014

Conversation

jtanner
Copy link
Contributor

@jtanner jtanner commented Sep 29, 2014

This is necessary when the underlying IP address of a host name is changed. Recently our redis provider (Redis Labs) did some maintenance and changed the IP address of the host to which our apps were connected. Rediscala was not able to reconnect after this IP change and our apps had to be rebooted.

This is necessary when the underlying IP address of a host name is
changed.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.14%) when pulling 31a2394 on SpinGo:bust-cache into b5f1769 on etaty:master.

@jtanner
Copy link
Contributor Author

jtanner commented Sep 30, 2014

Hmm, the failing test (RedisClientActor should ok) passes on my machine :/

@etaty
Copy link
Owner

etaty commented Sep 30, 2014

Yes it is Travis and the overloaded instances...
Your PR seems ok to me, i will merge it.

You solved the problem by making a new InetSocketAddress for each connection.
I am curious if there is a way to avoid to touch the DNS or if there is a cache in the jvm for such thing.

@jtanner
Copy link
Contributor Author

jtanner commented Sep 30, 2014

The JVM does cache DNS entries, which can be a problem if the entries are cached forever sun.net.InetAddressCachePolicy.get() == -1 see the code, but it should default to only caching for 30 seconds. However, that doesn't help when the InetAddress is cached in InetSocketAddress see the code.

etaty added a commit that referenced this pull request Oct 15, 2014
Clear cached InetSocketAddress on reconnect.
@etaty etaty merged commit 3741e1f into etaty:master Oct 15, 2014
@abustany
Copy link

Great :) Any plans to release a 1.4.1?

@etaty
Copy link
Owner

etaty commented Oct 15, 2014

done

@etaty etaty added this to the 1.4.1 milestone Oct 15, 2014
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants