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

Leaked Sockets when server reach maximum connections

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • None
    • 1.5.5, 1.1.10
    • Other
    • None

    Description

      reporting some issue :

      We are using mariadb-java-client-1.1.9 and have an issue when the maximum connections is reached on the MariaDB database.

      When trying to connect to a MariaDB database where the max connections was reached, the following exception is thrown: java.io.EOFException unexpected end of stream, read 0 bytes from 4. At this point the socket does not get closed and it leaks.

      Here is the stack trace from the Exception:
      MySQLProtocol.connect(String, int) line: 544
      MySQLProtocol.connect() line: 722
      MySQLProtocol.<init>(JDBCUrl, String, String, Properties) line: 281
      Driver.connect(String, Properties) line: 111
      DriverManager.getConnection(String, Properties, Class<?>) line: 664
      DriverManager.getConnection(String, Properties) line: 208

      The MySQLProtocol class where the exception is thrown is org.mariadb.jdbc.internal.mysql.MySQLProtocol.

      When we execute netstat -pan we have the following list of sockets:
      tcp 1 0 10.9.16.220:57313 10.9.16.224:3306 CLOSE_WAIT 9400/java

      tcp 1 0 10.9.16.220:57086 10.9.16.224:3306 CLOSE_WAIT 9400/java
      tcp 0 0 10.9.16.220:57159 10.9.16.224:3306 CLOSE_WAIT 9400/java
      
tcp 0 0 10.9.16.220:57151 10.9.16.224:3306 CLOSE_WAIT 9400/java
      ....

      The socket should get properly closed in such a scenario.

      Attachments

        Issue Links

          Activity

            People

              diego dupin Diego Dupin
              diego dupin Diego Dupin
              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.