The com.mongodb.ServerAddress#getSocketAddress() method is planned to be deprecated and eventually removed from the MongoDB driver, so replacing use of it with InetAddress.getByName(host) to resolve IP address.
This also fixes an issue where ServerAddress#getSocketAddress() throws a runtime exception that wraps UnknownHostException, and the exception is uncaught by this method and therefore does not complete normally. In this patch, UnknownHostException is caught and ignored.
The com.mongodb.ServerAddress#getSocketAddress() method is planned to be deprecated and eventually removed from the MongoDB driver, so replacing use of it with InetAddress.getByName(host) to resolve IP address.
This also fixes an issue where ServerAddress#getSocketAddress() throws a runtime exception that wraps UnknownHostException, and the exception is uncaught by this method and therefore does not complete normally. In this patch, UnknownHostException is caught and ignored.