mongodb / mongo-jdbc-driver

JDBC Driver for MongoDB Atlas SQL interface
Apache License 2.0
36 stars 33 forks source link

SQL-876: Propagate timeout from connection validation #102

Closed nbagnard closed 2 years ago

nbagnard commented 2 years ago

Timeout errors were not propagated properly and the connection validation was incorrectly successful leading to unclear errors when executing queries.

bucaojit commented 2 years ago

One of the unit tests, testBasicURL, is failing with java.sql.SQLTimeoutException: Timeout. Can't connect. I took a quick look and prior to the change the isValid() would also hit the exception and return false but the return was not being checked. We may need to change the unit test to account for the exception.

nbagnard commented 2 years ago

One of the unit tests, testBasicURL, is failing with java.sql.SQLTimeoutException: Timeout. Can't connect. I took a quick look and prior to the change the isValid() would also hit the exception and return false but the return was not being checked. We may need to change the unit test to account for the exception.

Oh, this is an issue with the test. Unit tests are not supposed to try to connect "for real". I updated the test to call getUnvalidatedConnection as it should have been doing.

nbagnard commented 2 years ago

evergreen merge