Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
2.2.1
-
None
-
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.