Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-682

java.sql.SQLNonTransientConnectionException: No connection available within the specified time

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.0
    • Fix Version/s: 2.4.1, 1.7.6
    • Component/s: Other
    • Labels:
      None
    • Environment:
      Debian 8. java-8-openjdk-amd64.

      Description

      After wait_timeout expires, server sends TCP RST to all TCP connections. Then JDBC tries to create another TCP connection, which seems successful, but for some reason JDBC closes this new TCP connection immediately.

      I use Maven artifact
      <groupId>org.mariadb.jdbc</groupId>
      <artifactId>mariadb-java-client</artifactId>
      <version>2.4.0</version>

      Then MariaDbPoolDataSource.getConnection() throws
      java.sql.SQLNonTransientConnectionException: No connection available within the specified time (option 'connectTimeout': 30,000 ms)

      What is strange - When I step through in debugger, then it works.

      To reproduce:
      1.
      Set up wait_timeout=60 in my.cnf .

      2.
      Run attached TcpRstMain2.java .

      3.
      See attached Wireshark.

      Thank you.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              diego dupin Diego Dupin
              Reporter:
              johny.dee Vaclav Havlik
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: