Derby
  1. Derby
  2. DERBY-5564

Code does different things depending if derby.locks.deadlockTrace=true is set

    Details

    • Issue & fix info:
      High Value Fix, Patch Available, Release Note Needed

      Description

      I see a problem in the code handling lock timeout exceptions. In the code in various places there are calls such as:

      // 2 kinds of errors here expected here. Either container not
      // found or could not obtain lock (LOCK_TIMEOUT or DEADLOCK).
      //
      // It is possible by the time this post commit work gets scheduled
      // that the container has been dropped and that the open container
      // call will return null - in this case just return assuming no
      // work to be done.

      if (se.getMessageId().equals(SQLState.LOCK_TIMEOUT) ||
      se.getMessageId().equals(SQLState.DEADLOCK))

      Or

      // First try to do the work in the nested transaction. Fail if we can't
      // get a lock immediately.
      if ( nestedTransaction != null )
      {
      try

      { return updateCurrentValueOnDisk( nestedTransaction, oldValue, newValue, false ); }

      catch (StandardException se)
      {
      if ( !se.getMessageId().equals( SQLState.LOCK_TIMEOUT ) )

      { throw se; }

      }

      Or

      // exception might have occured either container got dropper or lock not granted.
      // It is possible by the time this post commit work gets scheduled
      // that the container has been dropped and that the open container
      // call will return null - in this case just return assuming no
      // work to be done.

      //If this expcetion is because lock could not be obtained , work is requeued.
      if (se.getMessageId().equals(SQLState.LOCK_TIMEOUT) ||
      se.getMessageId().equals(SQLState.DEADLOCK))

      { requeue_work = true; }

      The problem that I see is that if the property "derby.locks.deadlockTrace=true" is set, then instead of a SQLState.LOCK_TIMEOUT, the code will see a SQLState.LOCK_TIMEOUT_LOG. Note that this is not being checked for in the above tests and others as well, so now the code behavior is going to change basd on whether the lock tracing is enabled or not.

      I think that 99% of the code that is testing for SQLState.LOCK_TIMEOUT should also be checking for SQLState.LOCK_TIMEOUT_LOG as well. I only see one place in DDLConstantAction where it is explicitly mentioned that SQLState.LOCK_TIMEOUT_LOG is not being looked at.

      1. releaseNote.html
        4 kB
        Mike Matrigali
      2. releaseNote.html
        4 kB
        Mike Matrigali
      3. releaseNote.html
        4 kB
        Kathey Marsden
      4. DERBY-5564.patch
        7 kB
        Brett Bergquist
      5. derby-5564_3.patch
        36 kB
        Mike Matrigali
      6. derby-5564_2.patch
        20 kB
        Mike Matrigali

        Issue Links

          Activity

          Brett Bergquist created issue -
          Brett Bergquist made changes -
          Field Original Value New Value
          Attachment DERBY-5564.patch [ 12509300 ]
          Mike Matrigali made changes -
          Assignee Mike Matrigali [ mikem ]
          Mike Matrigali made changes -
          Issue & fix info High Value Fix,Patch Available,Release Note Needed [ 10422,10102,10101 ]
          Mike Matrigali made changes -
          Attachment derby-5564_2.patch [ 12509954 ]
          Mike Matrigali made changes -
          Attachment derby-5564_3.patch [ 12510133 ]
          Mike Matrigali made changes -
          Fix Version/s 10.9.0.0 [ 12316344 ]
          Mike Matrigali made changes -
          Attachment releaseNote.html [ 12510271 ]
          Mike Matrigali made changes -
          Affects Version/s 10.7.1.1 [ 12315564 ]
          Affects Version/s 10.6.2.1 [ 12315343 ]
          Affects Version/s 10.5.3.0 [ 12314117 ]
          Affects Version/s 10.4.2.0 [ 12313345 ]
          Affects Version/s 10.3.3.0 [ 12313142 ]
          Affects Version/s 10.2.2.0 [ 12312027 ]
          Affects Version/s 10.1.3.1 [ 12311953 ]
          Mike Matrigali made changes -
          Attachment releaseNote.html [ 12510387 ]
          Mike Matrigali made changes -
          Fix Version/s 10.8.2.3 [ 12318540 ]
          Mike Matrigali made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 10.5.3.2 [ 12315436 ]
          Fix Version/s 10.6.2.3 [ 12315434 ]
          Fix Version/s 10.7.1.4 [ 12315902 ]
          Resolution Fixed [ 1 ]
          Knut Anders Hatlen made changes -
          Link This issue is related to DERBY-5961 [ DERBY-5961 ]
          Kathey Marsden made changes -
          Attachment releaseNote.html [ 12551736 ]
          Kathey Marsden made changes -
          Fix Version/s 10.8.3.0 [ 12323456 ]
          Fix Version/s 10.8.2.3 [ 12318540 ]
          Gavin made changes -
          Workflow jira [ 12647768 ] Default workflow, editable Closed status [ 12802120 ]
          Knut Anders Hatlen made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Mike Matrigali
              Reporter:
              Brett Bergquist
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development