Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-3320

Schema router times out connections from JDBC/C3P0 when database is defined

Details

    Description

      When a database is specified in the connection string of JDBC via C3P0 the connection times out. Works correctly with readconn:

      java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.

      at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118)
      at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:77)
      at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:690)
      at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140)
      at com.ecobee.foundation.ap2.api.response.Ap2CommandStatusUnitTest.testStuff(Ap2CommandStatusUnitTest.java:66)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
      at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
      at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
      at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)
      at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
      Caused by: com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@4f704591 – timeout at awaitAvailable()
      at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1467)
      at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:644)
      at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:554)
      at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:758)
      at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:685)
      ... 24 more

      Attachments

        Activity

          markus makela markus makela added a comment -

          How many unique databases exist across all the servers used by the schemarouter service? A large number of databases is the major cause of slowness with schemarouter as it has to discover each and every one of them.

          markus makela markus makela added a comment - How many unique databases exist across all the servers used by the schemarouter service? A large number of databases is the major cause of slowness with schemarouter as it has to discover each and every one of them.

          The setup is a schemarouter service that routes to a single readconnroute service.

          As an additional note, I've tested this with Hikari, C3P0, and the built in connection pooling DataSource bundled with mariadb connector-j, and am able to reproduce this issue with all of them.

          emmettu Emmett Underhill added a comment - The setup is a schemarouter service that routes to a single readconnroute service. As an additional note, I've tested this with Hikari, C3P0, and the built in connection pooling DataSource bundled with mariadb connector-j, and am able to reproduce this issue with all of them.
          markus makela markus makela added a comment -

          Since this issue was created, we've had several fixes that could relate to this. Can you try if this happens with the latest 2.5 release?

          markus makela markus makela added a comment - Since this issue was created, we've had several fixes that could relate to this. Can you try if this happens with the latest 2.5 release?

          People

            Unassigned Unassigned
            kjoiner Kyle Joiner (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.