opentracing-contrib / java-mongo-driver

OpenTracing Instrumentation for Mongo Driver
Apache License 2.0
13 stars 12 forks source link

Use InetAddress.getByName(host) to resolve IP address #25

Closed jyemin closed 1 year ago

jyemin commented 1 year ago

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.

jyemin commented 1 year ago

Closing due to lack of interest.