Issue Details (XML | Word | Printable)

Key: DERBY-715
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Mike Matrigali
Reporter: Mike Matrigali
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

lock deadlocks sometimes reported as lock timeouts

Created: 18/Nov/05 09:08 AM   Updated: 12/Jul/06 03:24 AM
Component/s: Services
Affects Version/s: 10.0.2.0
Fix Version/s: 10.1.3.1, 10.2.1.6

Time Tracking:
Not Specified

File Attachments:
  Size
Java Source File Licensed for inclusion in ASF works repro.java 2005-11-18 09:28 AM Mike Matrigali 4 kB

Resolution Date: 06/Dec/05 03:41 AM


 Description  « Hide
Sometimes a lock deadlock is reported as a lock timeout, even when the software has done a deadlock search and found it to be a deadlock.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mike Matrigali added a comment - 18/Nov/05 09:28 AM
slightly altered repro from the one bryan posted to DERBY-666, mostly just some extra prints.
On my ~2 ghz single processor laptop, running windows and jdk1.4.2 when I run the test the
first time I get a deadlock, and then mostly get timeouts reported for subsequent runs.
Note that the first time there are 0 rows in the table, but after each iteration there are some
committed deleted rows which changes the internal timing - to the user since the test never
commits there are always no rows in the tables.

It is
clear that the time to the timeout is the deadlock time - NOT the timeout time.

Mike Matrigali added a comment - 18/Nov/05 09:32 AM
I have not run tests on this diff yet, just posting to get some input on whether I am on the right track or not. Do not commit this patch until I have had a chance to get it reviewed and run tests.

Mike Matrigali added a comment - 02/Dec/05 09:51 AM
submitted to trunk as revision 351543.

Sometimes (timing dependent) a lock deadlock was incorrectly returned to the
user as a lock timeout. The code in LockSet was using the wrong variable
to determine if a deadlock had been detected, that variable sometimes was
right and sometimes wrong. Changed all the code to use the direct return
from the deadlock detection routine. Added a test that causes 5 deadlocks,
previous to the fix this test would always report at least 1 timeout on
my single processor, windows xp, laptop.

Mike Matrigali added a comment - 06/Dec/05 03:41 AM
svn 353812 ports fix from trunk to 10.1