Titan:Lock所有者等待自己的锁定导致com.sleepycat.je.LockTimeoutException

时间:2017-02-10 13:23:03

标签: locking titan tinkerpop3

我有一个使用Tinkerpop 3Titan Graph DB以及本地Berkeley存储后端的多线程Web应用程序。有时候,由于例外情况而导致提交失败:

  

交易 x 拥有 y

     

交易 x 等待 y

这当然令我感到困惑。怎么锁定所有者超时等待自己的锁?在第一次和第二次接近之后,相同的提交/回滚操作总是尝试最多3次,退避时间为1s和1.5s。我还确保事务之间不会泄漏事务(始终在每个请求的开始和结束时回滚)。最后,我尝试尽快释放任何锁。任何提示?

一些例子

示例例外1

Caused by: org.hsqldb.HsqlException: user lacks privilege or object not found: NUMBER
    at org.hsqldb.error.Error.error(Unknown Source)
    at org.hsqldb.ParserDQL.readTypeDefinition(Unknown Source)
    at org.hsqldb.ParserDDL.readColumnDefinitionOrNull(Unknown Source)
    at org.hsqldb.ParserDDL.compileCreateTableBody(Unknown Source)
    at org.hsqldb.ParserDDL.compileCreateTable(Unknown Source)
    at org.hsqldb.ParserDDL.compileCreate(Unknown Source)
    at org.hsqldb.ParserCommand.compilePart(Unknown Source)
    at org.hsqldb.ParserCommand.compileStatements(Unknown Source)
    at org.hsqldb.Session.executeDirectStatement(Unknown Source)
    at org.hsqldb.Session.execute(Unknown Source)
    ... 110 more

示例例外2

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

示例例外3

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

1 个答案:

答案 0 :(得分:0)

使用Titan's后继JanusGraph不再存在此问题。我认为这是Titan代码库中的一个错误。