Derby
  1. Derby
  2. DERBY-2749

Client connection closed during heavy load connections to network server

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 10.2.2.0
    • Fix Version/s: None
    • Component/s: Network Server
    • Labels:
      None
    • Environment:
      Sun JDK 1.5.0

      Description

      I am using HA-JDBC to cluster two machines with ~3,5 GB of data. It is a mailserver which gets about 100 mails per minute with each mail causing several SQL reads and writes. After synchronizing the 3,5 GB which takes around 15 minutes, soon after that I get this exception:

      Caused by: java.sql.SQLException: Unzureichende Daten beim Lesen aus dem Netz. Erwartet wurden mindestens 6 Bytes, empfangen wurden jedoch nur -1 Bytes. Die Verbindung wurde beendet.
      at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
      at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
      at org.apache.derby.client.am.PreparedStatement.executeUpdate(Unknown Source)
      at net.sf.hajdbc.sql.PreparedStatement$5.execute(PreparedStatement.java:144)
      at net.sf.hajdbc.sql.PreparedStatement$5.execute(PreparedStatement.java:142)
      at net.sf.hajdbc.sql.SQLObject$1.call(SQLObject.java:390)
      at net.sf.hajdbc.util.concurrent.SynchronousExecutor$SynchronousFuture.<init>(SynchronousExecutor.java:178)
      at net.sf.hajdbc.util.concurrent.SynchronousExecutor.submit(SynchronousExecutor.java:89)
      at net.sf.hajdbc.sql.SQLObject.executeWriteToDatabase(SQLObject.java:394)
      ... 11 more
      Caused by: org.apache.derby.client.am.DisconnectException: Unzureichende Daten beim Lesen aus dem Netz. Erwartet wurden mindestens 6 Bytes, empfangen wurden jedoch nur -1 Bytes. Die Verbindung wurde beendet.
      at org.apache.derby.client.net.Reply.fill(Unknown Source)
      at org.apache.derby.client.net.Reply.ensureALayerDataInBuffer(Unknown Source)
      at org.apache.derby.client.net.Reply.readDssHeader(Unknown Source)
      at org.apache.derby.client.net.Reply.startSameIdChainParse(Unknown Source)
      at org.apache.derby.client.net.NetStatementReply.readExecute(Unknown Source)
      at org.apache.derby.client.net.StatementReply.readExecute(Unknown Source)
      at org.apache.derby.client.net.NetPreparedStatement.readExecute_(Unknown Source)
      at org.apache.derby.client.am.PreparedStatement.readExecute(Unknown Source)
      at org.apache.derby.client.am.PreparedStatement.flowExecute(Unknown Source)
      at org.apache.derby.client.am.PreparedStatement.executeUpdateX(Unknown Source)
      ... 18 more

      The number of bytes read is in fact 0; I filed DERBY-2747 for this. I think the reason for this is the server issuing a Socket.close(). This seems to be called only by DRDAConnThread.closeSession() which is called by

      • DRDAConnThread.handleException(Exception)
      • DRDAConnThread.run()
      • DRDAConnThread.sessionInitialState()

      I did not set any timeslice, so the bugs mentioned in DERBY-2026 and DERBY-2748 should not apply. A timeout cannot happen on the client, as this would yield a SocketTimeoutException and not a read() of -1, so for some reason I believe, the server seems to close the connection.

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        Since the error happens on the server, the server-side exception probably provides more information. Please see if you can find the exception in derby.log and post the stack trace.

        Show
        Knut Anders Hatlen added a comment - Since the error happens on the server, the server-side exception probably provides more information. Please see if you can find the exception in derby.log and post the stack trace.
        Hide
        Kurt Huwig added a comment -

        I had a look at it, but there was no Exception in derby.log. Do I have to do anything to enable all logging? I saw some "if-this-and-that" surrounding the logging. As the server is in fact a server, I do not see anything logged to the console. I am using Sun's JDK logging.

        Show
        Kurt Huwig added a comment - I had a look at it, but there was no Exception in derby.log. Do I have to do anything to enable all logging? I saw some "if-this-and-that" surrounding the logging. As the server is in fact a server, I do not see anything logged to the console. I am using Sun's JDK logging.
        Hide
        Knut Anders Hatlen added a comment -

        I thought exceptions that closed the connection were logged by default, but you could try to lower derby.stream.error.logSeverityLevel.
        http://db.apache.org/derby/docs/10.2/tuning/rtunproper26985.html

        Show
        Knut Anders Hatlen added a comment - I thought exceptions that closed the connection were logged by default, but you could try to lower derby.stream.error.logSeverityLevel. http://db.apache.org/derby/docs/10.2/tuning/rtunproper26985.html
        Hide
        Kurt Huwig added a comment -

        I added this option to the config, but up to now I did not have this issue again. What I changed was to increase the number of derby.storage.pageCacheSize to 10.000 (which uses about 350 MB of RAM which is confusing, because it looks more like a 32kb page size, but I did not change the page size, so it should be the default of 4kb?!). This seems to make the problem disappear, but I've got a bad feeling about it. The database file size is 3.8GB.

        Show
        Kurt Huwig added a comment - I added this option to the config, but up to now I did not have this issue again. What I changed was to increase the number of derby.storage.pageCacheSize to 10.000 (which uses about 350 MB of RAM which is confusing, because it looks more like a 32kb page size, but I did not change the page size, so it should be the default of 4kb?!). This seems to make the problem disappear, but I've got a bad feeling about it. The database file size is 3.8GB.
        Hide
        Kathey Marsden added a comment -

        I don't think this is a confirmed regression so should not have the "Existing Application Impact" box checked.

        Show
        Kathey Marsden added a comment - I don't think this is a confirmed regression so should not have the "Existing Application Impact" box checked.
        Hide
        Kathey Marsden added a comment -

        Can we close this cannot reproduce?

        Show
        Kathey Marsden added a comment - Can we close this cannot reproduce?
        Hide
        Rick Hillegas added a comment -

        Closing this issue because:

        1) There is a workaround.

        2) There is no reproducible test case.

        3) There has been no activity on this issue for a year.

        Show
        Rick Hillegas added a comment - Closing this issue because: 1) There is a workaround. 2) There is no reproducible test case. 3) There has been no activity on this issue for a year.

          People

          • Assignee:
            Unassigned
            Reporter:
            Kurt Huwig
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development