Java Driver
  1. Java Driver
  2. JAVA-266

Need to update the IP resolved for hosts frequently enough to pick up dns changes

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major - P3 Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5
    • Component/s: None
    • Labels:
      None
    • # Replies:
      2
    • Last comment by Customer:
      true

      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

        Issue Links

          Activity

          Hide
          auto
          added a comment -

          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

          Show
          auto
          added a comment - 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
          Hide
          Antoine Girbal
          added a comment -

          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).

          Show
          Antoine Girbal
          added a comment - 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).

            People

            • Assignee:
              Antoine Girbal
              Reporter:
              Antoine Girbal
              Participants:
              Last commenter:
              Barrie Segal
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                3 years, 8 weeks, 6 days ago
                Date of 1st Reply: