[JAVA-266] Need to update the IP resolved for hosts frequently enough to pick up dns changes Created: 04/Feb/11  Updated: 29/Mar/13  Resolved: 24/Feb/11

Status: Closed
Project: Java Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 2.5

Type: Improvement Priority: Major - P3
Reporter: Antoine Girbal Assignee: Antoine Girbal
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to JAVA-707 Refresh the IP resolved for hosts fre... Closed

 Description   

right now it seems ServerAddress cache the InetAddress and will be used forever.
Need to be purged either:

  • at intervals, e.g. 5min
  • whenever an open connection fails


 Comments   
Comment by Antoine Girbal [ 24/Feb/11 ]

the replset updater thread will clear the inetaddress from nodes at constant interval.
the interval can be changed with com.mongodb.inetAddrCacheMS and is set to 5min by default (0 means off).
Tested successfully changing IP of 1 server, driver successfully used new one after 5min.
Note that this feature is only available with repl set (which should be enough).

Comment by auto [ 24/Feb/11 ]

Author:

{u'login': u'agirbal', u'name': u'agirbal', u'email': u'antoine@10gen.com'}

Message: JAVA-266: Need to update the IP resolved for hosts frequently enough to pick up dns changes
https://github.com/mongodb/mongo-java-driver/commit/892869f5e7d843133f22ea8ab17bf619ccd65071

Generated at Thu Feb 08 08:51:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.