reporting some issue :
We are using mariadb-java-client-1.1.9 and have an issue when the maximum connections is reached on the MariaDB database.
When trying to connect to a MariaDB database where the max connections was reached, the following exception is thrown: java.io.EOFException unexpected end of stream, read 0 bytes from 4. At this point the socket does not get closed and it leaks.
Here is the stack trace from the Exception:
MySQLProtocol.connect(String, int) line: 544
MySQLProtocol.connect() line: 722
MySQLProtocol.<init>(JDBCUrl, String, String, Properties) line: 281
Driver.connect(String, Properties) line: 111
DriverManager.getConnection(String, Properties, Class<?>) line: 664
DriverManager.getConnection(String, Properties) line: 208
The MySQLProtocol class where the exception is thrown is org.mariadb.jdbc.internal.mysql.MySQLProtocol.
When we execute netstat -pan we have the following list of sockets:
tcp 1 0 10.9.16.220:57313 10.9.16.224:3306 CLOSE_WAIT 9400/java
tcp 1 0 10.9.16.220:57086 10.9.16.224:3306 CLOSE_WAIT 9400/java
tcp 0 0 10.9.16.220:57159 10.9.16.224:3306 CLOSE_WAIT 9400/java
tcp 0 0 10.9.16.220:57151 10.9.16.224:3306 CLOSE_WAIT 9400/java
The socket should get properly closed in such a scenario.