Double M
Double M

Reputation: 1503

Titan: Lock owner waits for own lock causing com.sleepycat.je.LockTimeoutException

I have a multi-threaded web application using Tinkerpop 3 and Titan Graph DB plus a local Berkeley storage backend. Occasionally, commits fail due to exceptions like:

Transaction x owns y

Transaction x waits for y

Which is of course puzzling me. How come the lock owner times out waiting for its own lock? The same commit/rollback operation is always attempted up to 3 times with a backoff time of 1s and 1.5s after the first and second approach, respecively. I am also making sure that transactions do not leak between requests (always rolling back at the start and end of each request). At last, I try to release any locks as soon as possible. Any hints?

Some Examples

Example Exception 1

Caused by: com.sleepycat.je.LockTimeoutException: (JE 5.0.73) Lock expired. Locker 1437370674 2837_jWebSocket TCP-Connector 01.52499.3_Txn: waited for lock on database=edgestore LockAddr:1418570977 LSN=0x0/0x7498 type=WRITE grant=WAIT_PROMOTION timeoutMillis=500 startTime=1486450928285 endTime=1486450928785
Owners: [<LockInfo locker="1437370674 2837_jWebSocket TCP-Connector 01.52499.3_Txn" type="READ"/>, <LockInfo locker="1628779116 2189_pool-4-thread-1_Txn" type="READ"/>]
Waiters: []
Transaction 1437370674 2837_jWebSocket TCP-Connector 01.52499.3_Txn owns LockAddr:1418570977 <LockInfo locker="1437370674 2837_jWebSocket TCP-Connector 01.52499.3_Txn" type="READ"/>
Transaction 1437370674 2837_jWebSocket TCP-Connector 01.52499.3_Txn waits for LockAddr:1418570977

Example Exception 2

Caused by: com.sleepycat.je.LockTimeoutException: (JE 5.0.73) Lock expired. Locker 1938532737 6471_ForkJoinPool-1-worker-1_Txn: waited for lock on database=edgestore LockAddr:2056488084 LSN=0x0/0x5a1db type=WRITE grant=WAIT_PROMOTION timeoutMillis=500 startTime=1486457805980 endTime=1486457806480
Owners: [<LockInfo locker="1938532737 6471_ForkJoinPool-1-worker-1_Txn" type="READ"/>, <LockInfo locker="1223191726 6475_pool-16-thread-1_Txn" type="READ"/>]
Waiters: []
Transaction 1938532737 6471_ForkJoinPool-1-worker-1_Txn owns LockAddr:2056488084 <LockInfo locker="1938532737 6471_ForkJoinPool-1-worker-1_Txn" type="READ"/>
Transaction 1938532737 6471_ForkJoinPool-1-worker-1_Txn waits for LockAddr:2056488084

Example Exception 3

Caused by: com.sleepycat.je.LockTimeoutException: (JE 5.0.73) Lock expired. Locker 1723301468 1446_pool-3-thread-1_Txn: waited for lock on database=edgestore LockAddr:1184880090 LSN=0x0/0xa966 type=WRITE grant=WAIT_PROMOTION timeoutMillis=500 startTime=1486730956580 endTime=1486730957080
Owners: [<LockInfo locker="1577323761 1489_Thread-41_Txn" type="READ"/>, <LockInfo locker="1723301468 1446_pool-3-thread-1_Txn" type="READ"/>, <LockInfo locker="1845682412 1451_Thread-40_Txn" type="READ"/>]
Waiters: [<LockInfo locker="2126118378 1517_Thread-42_Txn" type="READ"/>]
Transaction 1723301468 1446_pool-3-thread-1_Txn owns LockAddr:1184880090 <LockInfo locker="1723301468 1446_pool-3-thread-1_Txn" type="READ"/>
Transaction 1723301468 1446_pool-3-thread-1_Txn waits for LockAddr:1184880090

Upvotes: 1

Views: 599

Answers (1)

Double M
Double M

Reputation: 1503

This issue no longer exists using Titan's successor JanusGraph. I presume it was a bug within the Titan code base.

Upvotes: 2

Related Questions