vert-x3 / vertx-jdbc-client

JDBC support for Vert.x
Apache License 2.0
126 stars 90 forks source link

Get connection hangs if a host name has dashes #307

Closed eniese-petersen closed 1 year ago

eniese-petersen commented 1 year ago

Version

Found in 4.4.3

Context

I encountered an exception while getting a SQL connection.

Exception in thread "vertx-jdbc-service-get-connection-thread" java.lang.NumberFormatException: Cannot parse null string at java.base/java.lang.Integer.parseInt(Integer.java:627) at java.base/java.lang.Integer.parseInt(Integer.java:781) at io.vertx.ext.jdbc.impl.JDBCClientImpl.lambda$null$4(JDBCClientImpl.java:251) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1589)

And the exception is not returned to handler

It seems HOST_AND_PORT_PATTERN doesn't allow for dashes in the host domain. It breaks the grouping and group 2 for port is null

vietj commented 1 year ago

this will be fixed in 4.4.4 that will be released by the end of this week