[CONJ-564] Never ever throw an instance of java.lang.Error Created: 2018-01-01  Updated: 2018-02-20  Resolved: 2018-01-23

Status: Closed
Project: MariaDB Connector/J
Component/s: authentication, Other
Affects Version/s: 2.2.1
Fix Version/s: 2.2.2, 1.7.2

Type: Bug Priority: Major
Reporter: Wolfgang Glas Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None
Environment:

commons-pool2



 Description   

We had a setup of commons-pool2 and mariadb-connector-j got stuck, because creating a MariaDB connection threw a Throwable, which was derived from java.lang.Error, see https://issues.apache.org/jira/browse/POOL-336 for details.

The exact cause may also be due to an openjdk8 bug under Linux in sun.nio.ch.DatagramChannelImpl.connect(SocketAddress), because commons-pool2 does not log swallowed exception during connection establishment.

However, the discussion in the above mentioned issue showed, that actively throwing an instance of java.lang.Error like an AssertionError or an IOError is a bad idea, because such erros are usually thrown by the JVM as a last resort.

I will prepare a pull request for this issue, which replaces the thrown Errors by likewise RuntimeExceptions.



 Comments   
Comment by Wolfgang Glas [ 2018-01-01 ]

Created pull request
https://github.com/MariaDB/mariadb-connector-j/pull/119

Comment by Diego Dupin [ 2018-01-23 ]

merged https://github.com/MariaDB/mariadb-connector-j/pull/119 in develop branch.

Available in 2.2.2-SNAPSHOT version.

Generated at Thu Feb 08 03:16:41 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.