Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with MariaDB Java Client 1.1.7 #175

Closed
ernst-riemer opened this issue Nov 5, 2014 · 5 comments
Closed

Issue with MariaDB Java Client 1.1.7 #175

ernst-riemer opened this issue Nov 5, 2014 · 5 comments

Comments

@ernst-riemer
Copy link

Hi there,

Just noticed that HikariCP (Java6) stopped working with 2.2.0 & 2.2.3 (works with 2.1.0) with the latest MariaDB Java client (1.1.7).

I've included a snippet of the stack trace below.

Regards,

Ernst

Caused by: java.lang.RuntimeException: Fail-fast during pool initialization
    at com.zaxxer.hikari.pool.HikariPool.fillPool(HikariPool.java:505)
    at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:163)
    at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:114)
    at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:78)
    ... 46 more
Caused by: java.sql.SQLFeatureNotSupportedException: Not yet supported
    at org.mariadb.jdbc.internal.SQLExceptionMapper.getFeatureNotSupportedException(SQLExceptionMapper.java:165)
    at org.mariadb.jdbc.MySQLConnection.setNetworkTimeout(MySQLConnection.java:1319)
    at com.zaxxer.hikari.util.PoolUtilities.setNetworkTimeout(PoolUtilities.java:299)
    at com.zaxxer.hikari.pool.HikariPool.addConnection(HikariPool.java:425)
    at com.zaxxer.hikari.pool.HikariPool.fillPool(HikariPool.java:504)
    ... 60 more
@brettwooldridge
Copy link
Owner

We will implement a workaround for this, but the issue seems to be caused by a bug in the MariaDB driver.

We call connection.getNetworkTimeout() to determine whether network timeout is supported. If network timeout is not supported, we expect a SQLFeatureNotSupportedException exception (like above) from this call. However, connection.getNetworkTimeout() is simply returning the value 0. Therefore, we are expecting that timeout is supported. Subsequently, we call connection.setNetworkTimeout() and at this point a SQLFeatureNotSupportedException is thrown.

MariaDB, if it does not support setNetworkTimeout() should also throw SQLFeatureNotSupportedException for getNetworkTimeout(). Please open a bug against the MariaDB JDBC driver. As I said, we will implement a workaround, but this is improper behavior from their driver.

@brettwooldridge
Copy link
Owner

We have deployed a snapshot (2.2.4-SNAPSHOT), can you check it to validate if it fixes this issue.

@ernst-riemer
Copy link
Author

Thanks, this works!

I've also filed a bug on the MariaDB jira for the java driver

Regards,
Ernst

@ernst-riemer
Copy link
Author

FYI - response from the Maria jira

It is a matter of opinion. getNetworkTimeout, as it is documented returns 0 if there is no network timeout (if it is infinite). What is the reason not to suport it if its support is trivial .
OTOH, supporting for setNetworkTimeout is also trivial via socket option (one just needs to make sure to close connections once this timeout fires)

@brettwooldridge
Copy link
Owner

Thank you, I have added HikariCP's perspective to that Jira issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants