[JAVA-2700] Implement fallback to IP v4/IP v6 vice-versa Created: 11/Dec/17  Updated: 28/Oct/23  Resolved: 05/Oct/18

Status: Closed
Project: Java Driver
Component/s: Connection Management
Affects Version/s: None
Fix Version/s: 3.9.0

Type: New Feature Priority: Major - P3
Reporter: Rathi Gnanasekaran Assignee: Jonathan Ma
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by DRIVERS-402 Implement fallback to IP v4/IP v6 vic... Closed
Related
related to JAVA-3016 Reduce test time by making it easier ... Closed

 Description   

The driver should try to connect to all IP addresses returned from java.net.InetAddress#getAllByName(java.lang.String) instead of just the first one as returned from java.net.InetAddress#getByName(java.lang.String) before giving up trying to connect.



 Comments   
Comment by Githook User [ 05/Oct/18 ]

Author:

{'name': 'Jonathan', 'email': 'thejonathanma@gmail.com', 'username': 'thejonathanma'}

Message: Implement ip address fallback for hostnames in async

This commit implements the ip address fallback for the async driver.
This applies for both async and netty. Tests are included for this
as well.

JAVA-2700
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/c9913ca42ab0978029449955a56e05386d2caa91

Comment by Jonathan Ma [ 03/Oct/18 ]

Github PR for async implementation

Comment by Githook User [ 27/Sep/18 ]

Author:

{'name': 'Jonathan', 'email': 'thejonathanma@gmail.com', 'username': 'thejonathanma'}

Message: Implement fallback to IPv4/IPv6 vice-versa for sync

This commit changes the way the driver attempts connections to the
ip addresses that are associated with a host. Instead of only fetching
the first ip address and attempting a connection that single ip address,
the driver will now fetch all of the ip addresses and attempt to
connect to each one until a successful connection is made, or until
it is determined that none of the ip addresses can be connected to.
Note that this commit is only for sync. The implementation of this
for async will be handled in a separate commit. A couple of tests
were added for this change as well.

JAVA-2700
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/146c465c8be582a51b4763e2a0b8b0b93e8d072d

Comment by Jonathan Ma [ 25/Sep/18 ]

Github PR for sync implementation.

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