-
Notifications
You must be signed in to change notification settings - Fork 870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
transaction blocked in java code when there is a binary node inside to delete #5614
Comments
could you please share a thread dump? (a kill -3 of the process will do the trick). It will help us to understand where the problem is Thanks Luigi |
"http-nio-8080-exec-7" #122 daemon prio=5 os_prio=0 tid=0x00007ffaa465f000 nid=0xee5 waiting on condition [0x00007ffaf6e97000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x000000008a5c8918> (a java.util.concurrent.locks.ReentrantLock$NonfairSync) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836) at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:870) at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1199) at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:209) at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:285) at com.orientechnologies.common.concur.lock.OAdaptiveLock.lock(OAdaptiveLock.java:99) at com.orientechnologies.orient.enterprise.channel.OChannel.acquireReadLock(OChannel.java:121) at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:182) at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:171) at com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(OStorageRemote.java:2153) at com.orientechnologies.orient.client.remote.OStorageRemote.commit(OStorageRemote.java:1381) at com.orientechnologies.orient.client.remote.OStorageRemoteThread.commit(OStorageRemoteThread.java:453) at com.orientechnologies.orient.core.tx.OTransactionOptimistic.doCommit(OTransactionOptimistic.java:596) at com.orientechnologies.orient.core.tx.OTransactionOptimistic.commit(OTransactionOptimistic.java:156) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2659) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2628) at com.123abc.dao.orientdb.BoDAO.removeABC(BoDAO.java:1540) "OrientDB <- Asynch Client (/127.0.0.1:2424)" #104 daemon prio=5 os_prio=0 tid=0x00007ffa8c013000 nid=0xece runnable [0x00007ffafc182000] java.lang.Thread.State: RUNNABLE at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:150) at java.net.SocketInputStream.read(SocketInputStream.java:121) at java.io.BufferedInputStream.fill(BufferedInputStream.java:246) at java.io.BufferedInputStream.read(BufferedInputStream.java:265) - locked <0x000000008a5c8b78> (a java.io.BufferedInputStream) at java.io.DataInputStream.readByte(DataInputStream.java:265) at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.readByte(OChannelBinary.java:73) at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:200) at com.orientechnologies.orient.enterprise.channel.binary.OAsynchChannelServiceThread.execute(OAsynchChannelServiceThread.java:50) at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:77) "OrientDB <- Asynch Client (/127.0.0.1:2424)" #103 daemon prio=5 os_prio=0 tid=0x00007ffa8c011800 nid=0xecc runnable [0x00007ffafc283000] java.lang.Thread.State: RUNNABLE at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:150) at java.net.SocketInputStream.read(SocketInputStream.java:121) at java.io.BufferedInputStream.fill(BufferedInputStream.java:246) at java.io.BufferedInputStream.read(BufferedInputStream.java:265) - locked <0x000000008a5c8398> (a java.io.BufferedInputStream) at java.io.DataInputStream.readByte(DataInputStream.java:265) at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.readByte(OChannelBinary.java:73) at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:200) at com.orientechnologies.orient.enterprise.channel.binary.OAsynchChannelServiceThread.execute(OAsynchChannelServiceThread.java:50) at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:77) the thread blocked is the first one ... when i try to remove the documents. |
Hi, |
eventually if you can t find the bug ... i ll build a example in java code creating the block and will submit all the code so you have all the context repeatable |
That will be amazing, we are struggling a bit to reproduce. |
i investigated in all the transaction code ... deleting in alternate way block of code .... now i can block also the console using javascript :) js var a=db.command("select from #33:341"); db.begin(); db.delete(a[0].identity); db.commit(); now i trying to delete different nodes.... |
solved.
|
Hi, In oriendb there is no concept of nested transaction, the begin();commit(); block works as a "require transaction" so if one is already running it countinue it if not it create it and commit at the end. Knowing that if an error happen somewhere, the whole transaction is rollbacked. for the problem with the select of binary content we are checking that, track it in the other issue, anyway you can load a binary record with db.load(new ORecordId(33,341)); by the way, can we close this ? |
Hi , i know that nested transaction is not handled for now in orientdb. But as you told it might work continuing the transaction normally.... not blocking the thread in any case. In that old block code i opened a nested transaction. Inside the block , there is a exception , so rolling back in the try cach of nested transaction.... and thread was blocked . The issue is related to a block of thread .... a suggestion to verify if in that condition all is ok. Apparently in this case the status of transaction is inconsistent. The nested transaction was inside a triggered function. It is a rare case surelly so priority could be low for investigation, but a thread bock could create serious problem in a production for a orientdb's general customer (for example it was inside a distributed lock ... so server got blocked for all requests :) not in prod fortunately) Anyway my code is changed now and i solved diversely the problem:) |
i found the problem. There is a Class A with a trigger on delete. db.begin() try{ .... }catch(e){ db.rollback(); throw e; } writing a lot of trancing log... i saw that after is called db.begin()... the Thread get blocked on remote client For now for evoiding the block of thread ... i m using in js var txcount=db.transaction.amountOfNestedTxs() for understanding if i m in a transaction or not. |
Hi @publicocean0 Does this solution works for you ? |
in this way ? db.begin() .... if (error) throw "error"; Anyway that function inside the trigger function in my case is a function used also in other calls , so in some cases it is in a parent transaction in other no. |
Hi , сб, 5 Мар 2016, 11:50 publicocean0 notifications@github.com:
twitter:@Andrey_Lomakin linkedin:https://ua.linkedin.com/in/andreylomakin |
can we close this ? |
Hi sorry if I can t answer in this period . I m working in another project very hard. No time. I will write asap. You can close if you want eventually I will reopen |
Closing it, in case reopen it. Thanks. |
considering the bug # 5613
there is another bug related to previous one
in my java code
i have a transaction deleting
a binary document A and a document B with a link to A.
commit function block indefinitely the thread executing the code
specular transaction for inserting /updating works well. The problems seams in delection.
The text was updated successfully, but these errors were encountered: