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

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 2.4.0
    • 1.7.6, 2.4.1
    • Other
    • None
    • 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

        1. mariadb_jdbc_bug.png
          285 kB
          Vaclav Havlik
        2. TcpRstMain2.java
          1.0 kB
          Vaclav Havlik

        Issue Links

          Activity

            People

              diego dupin Diego Dupin
              johny.dee Vaclav Havlik
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.