Derby
  1. Derby
  2. DERBY-2029

Query timeout does not take effect if server machine crashes

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.2.2.0, 10.3.1.4
    • Fix Version/s: None
    • Component/s: JDBC, Network Client
    • Environment:
      Solaris 10, JDK 1.5
    • Urgency:
      Normal
    • Issue & fix info:
      Repro attached

      Description

      An application using the client driver will hang "infinite" if the
      server machine running the Derby server crashes during execution of a
      query even if it has specified a query timeout using
      Statement.setQueryTimeout().

      This problem can be reproduced (at least on Solaris 10) by:

      1. starting a Derby server on one machine and a Derby client on the second machine.
      2. In a Java program, create a connection and a statement and set the
      query timeout for the statement to a few seconds by:

      Statement.setQueryTimeout(10)

      3. Execute a query that take some time (more than 10 seconds).
      4. During execute of the query, take the power on the machine running
      the Derby server.
      5. Your program will hang "infinite".

      I will post a short repro program that can be used.

      1. QueryTimeout.java
        2 kB
        Olav Sandstaa

        Activity

        Hide
        Olav Sandstaa added a comment -

        This program can be used for reproducing this problem. In addition to this program you need at least two machines and be willing to take the power on one of them.

        Here is how to reproduce the problem:

        1. Start a Derby server on one of the machines
        2. Change the jdbc url to your server and port number
        3. Start this program on the second machine
        4. Within 1 minute after starting the program, take the power on the machine running the Derby server.
        5. This program will hang "infinite" long.

        If you skip step 4 above, the program get a (query) timeout after about 1 minute.

        Show
        Olav Sandstaa added a comment - This program can be used for reproducing this problem. In addition to this program you need at least two machines and be willing to take the power on one of them. Here is how to reproduce the problem: 1. Start a Derby server on one of the machines 2. Change the jdbc url to your server and port number 3. Start this program on the second machine 4. Within 1 minute after starting the program, take the power on the machine running the Derby server. 5. This program will hang "infinite" long. If you skip step 4 above, the program get a (query) timeout after about 1 minute.
        Hide
        Julius Stroffek added a comment -

        What about other failures? Unplugging the network cable, killing the derby server, etc. The issue does not appear in these cases?

        Show
        Julius Stroffek added a comment - What about other failures? Unplugging the network cable, killing the derby server, etc. The issue does not appear in these cases?
        Hide
        Olav Sandstaa added a comment -

        I have not tried to test with the other failures you mention, but I would expect this to be:

        unplugging the network cable on the client machine: depending on which OS you run, the timeout would work
        unplugging the network cable on the server machine: the timeout would not work and Derby would hang "forever"
        killing the derby server: the timeout would work

        If the timout works or not in these cases depends on whether the TCP-layer is able to detect that the server is no longer available. If "crashing" the server or unplugging the net on the server, the TCP layer on the client will not be informed about this for a rather long time period.

        Show
        Olav Sandstaa added a comment - I have not tried to test with the other failures you mention, but I would expect this to be: unplugging the network cable on the client machine: depending on which OS you run, the timeout would work unplugging the network cable on the server machine: the timeout would not work and Derby would hang "forever" killing the derby server: the timeout would work If the timout works or not in these cases depends on whether the TCP-layer is able to detect that the server is no longer available. If "crashing" the server or unplugging the net on the server, the TCP layer on the client will not be informed about this for a rather long time period.
        Hide
        Knut Anders Hatlen added a comment -

        Triaged for 10.5.2.

        Show
        Knut Anders Hatlen added a comment - Triaged for 10.5.2.

          People

          • Assignee:
            Unassigned
            Reporter:
            Olav Sandstaa
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development