You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by "Enrico Daga (enridaga)" <en...@gmail.com> on 2017/05/08 10:23:20 UTC

Fuseki/TDB stuck: ~150 threads BLOCKED waiting to lock the same object

Good morning,

I have an instance of Fuseki 2.3.1 running in production that sometimes hangs, leaving a long set of CLOSE_WAIT connections with Apache (its proxy).
It looks like connections are left hanging ignoring the timeout in the configuration, therefore I need to shut down the VM, delete the lock files manually and restart.
However, this is happening quite often recently (probably because of an increase of activity).
Looking into it with jstack, I observed ~150 threads in BLOCKED state, all waiting to lock *the same* object.
Here is one:

"qtp2123914473-3049" #3049 prio=5 os_prio=0 tid=0x00007f1ae9909000 nid=0x5016 waiting for monitor entry [0x00007f15d7108000]
   java.lang.Thread.State: BLOCKED (on object monitor)
    at org.apache.jena.tdb.store.nodetable.NodeTableCache._idForNode(NodeTableCache.java:144)
    - waiting to lock <0x00000004c007ffa8> (a java.lang.Object)
    at org.apache.jena.tdb.store.nodetable.NodeTableCache.getNodeIdForNode(NodeTableCache.java:87)
    at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
    at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
    at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
    at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
    at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
    at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
    at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
    at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
    at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
    at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
    at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
    at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
    at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
    at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
    at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
    at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
    at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
    at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
    at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
    at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
[…]

These three objects call each other for a while in the stack.

Looking at the issues, it might be similar to what observed here [1], although version 2.3.1 did not seem to be affected (BTW, the issue says FIXED but reading the comments it looks like the problem was not reproduced).
It looks like a deadlock, I was wondering whether anybody have seen this before?

Thank you for any feedback,

Enrico


[1] https://issues.apache.org/jira/browse/JENA-1296


—
Enrico Daga (enridaga)
http://www.enridaga.net
Il budda e’ nel parco.






Re: Fuseki/TDB stuck: ~150 threads BLOCKED waiting to lock the same object

Posted by Andy Seaborne <an...@apache.org>.
What I'm not seeing is why this is related to CLOSE_WAIT but that migth 
be causing a general system effect.

See JENA-1335 for that.

Could you raise a separate JIRA for the NodeTableCache lockup, 
especially explaining the environment and usage.

But caution - unless there is a reproducible test that makes it happen 
elsewhere, it is very hard to make any progress.

     Andy


On 10/05/17 10:26, Enrico Daga (enridaga) wrote:
> Hi Andy,
>
> below is the thread that is locking the object.
> However, there is no other mention of the other object it is “parking to wait for”.
> Also, the system was totally stuck as the output of jstack was exactly the same after 15 minutes (tested with diff).
> I can provide it in full if useful.
>
> Enrico
>
>
> "qtp2123914473-2423" #2423 prio=5 os_prio=0 tid=0x00007f1adcf3c800 nid=0x51a5 waiting on condition [0x00007f182605
> 4000]
>    java.lang.Thread.State: WAITING (parking)
>     at sun.misc.Unsafe.park(Native Method)
>     - parking to wait for  <0x00000004c007aba8> (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 org.apache.jena.ext.com.google.common.cache.LocalCache$Segment.put(LocalCache.java:2825)
>     at org.apache.jena.ext.com.google.common.cache.LocalCache.put(LocalCache.java:4149)
>     at org.apache.jena.ext.com.google.common.cache.LocalCache$LocalManualCache.put(LocalCache.java:4754)
>     at org.apache.jena.atlas.lib.cache.CacheGuava.put(CacheGuava.java:76)
>     at org.apache.jena.tdb.store.nodetable.NodeTableCache.cacheUpdate(NodeTableCache.java:205)
>     at org.apache.jena.tdb.store.nodetable.NodeTableCache._retrieveNodeByNodeId(NodeTableCache.java:129)
>     - locked <0x00000004c007ffa8> (a java.lang.Object)
>     at org.apache.jena.tdb.store.nodetable.NodeTableCache.getNodeForNodeId(NodeTableCache.java:82)
>     at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeForNodeId(NodeTableWrapper.java:54)
>
>
>
> —
> Enrico Daga (enridaga)
> http://www.enridaga.net
> Il budda e’ nel parco.
>
>
>
>
>
>> On 8 May 2017, at 13:46, Andy Seaborne <an...@apache.org> wrote:
>>
>> Hi Enrico,
>>
>> JENA-1224 was a different effect but might be a related.  It accounts for very log stacks.
>>
>> It was addressed after Fuseki 2.3.1 - could it be possible for you to try current Fuseki?
>>
>> In jstack, what is the thread holding the lock doing?
>>
>> 	Andy
>>
>> On 08/05/17 11:23, Enrico Daga (enridaga) wrote:
>>> Good morning,
>>>
>>> I have an instance of Fuseki 2.3.1 running in production that sometimes hangs, leaving a long set of CLOSE_WAIT connections with Apache (its proxy).
>>> It looks like connections are left hanging ignoring the timeout in the configuration, therefore I need to shut down the VM, delete the lock files manually and restart.
>>> However, this is happening quite often recently (probably because of an increase of activity).
>>> Looking into it with jstack, I observed ~150 threads in BLOCKED state, all waiting to lock *the same* object.
>>> Here is one:
>>>
>>> "qtp2123914473-3049" #3049 prio=5 os_prio=0 tid=0x00007f1ae9909000 nid=0x5016 waiting for monitor entry [0x00007f15d7108000]
>>>   java.lang.Thread.State: BLOCKED (on object monitor)
>>>    at org.apache.jena.tdb.store.nodetable.NodeTableCache._idForNode(NodeTableCache.java:144)
>>>    - waiting to lock <0x00000004c007ffa8> (a java.lang.Object)
>>>    at org.apache.jena.tdb.store.nodetable.NodeTableCache.getNodeIdForNode(NodeTableCache.java:87)
>>>    at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
>>>    at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
>>>    at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
>>>    at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
>>>    at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
>>>    at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
>>>    at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
>>>    at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
>>>    at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
>>>    at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
>>>    at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
>>>    at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
>>>    at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
>>>    at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
>>>    at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
>>>    at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
>>>    at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
>>>    at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
>>>    at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
>>>    at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
>>> […]
>>>
>>> These three objects call each other for a while in the stack.
>>>
>>> Looking at the issues, it might be similar to what observed here [1], although version 2.3.1 did not seem to be affected (BTW, the issue says FIXED but reading the comments it looks like the problem was not reproduced).
>>> It looks like a deadlock, I was wondering whether anybody have seen this before?
>>>
>>> Thank you for any feedback,
>>>
>>> Enrico
>>>
>>>
>>> [1] https://issues.apache.org/jira/browse/JENA-1296
>>>
>>>
>>> —
>>> Enrico Daga (enridaga)
>>> http://www.enridaga.net
>>> Il budda e’ nel parco.
>>>
>>>
>>>
>>>
>>>
>

Re: Fuseki/TDB stuck: ~150 threads BLOCKED waiting to lock the same object

Posted by "Enrico Daga (enridaga)" <en...@gmail.com>.
Hi Andy,

below is the thread that is locking the object. 
However, there is no other mention of the other object it is “parking to wait for”.
Also, the system was totally stuck as the output of jstack was exactly the same after 15 minutes (tested with diff). 
I can provide it in full if useful.

Enrico


"qtp2123914473-2423" #2423 prio=5 os_prio=0 tid=0x00007f1adcf3c800 nid=0x51a5 waiting on condition [0x00007f182605
4000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <0x00000004c007aba8> (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 org.apache.jena.ext.com.google.common.cache.LocalCache$Segment.put(LocalCache.java:2825)
    at org.apache.jena.ext.com.google.common.cache.LocalCache.put(LocalCache.java:4149)
    at org.apache.jena.ext.com.google.common.cache.LocalCache$LocalManualCache.put(LocalCache.java:4754)
    at org.apache.jena.atlas.lib.cache.CacheGuava.put(CacheGuava.java:76)
    at org.apache.jena.tdb.store.nodetable.NodeTableCache.cacheUpdate(NodeTableCache.java:205)
    at org.apache.jena.tdb.store.nodetable.NodeTableCache._retrieveNodeByNodeId(NodeTableCache.java:129)
    - locked <0x00000004c007ffa8> (a java.lang.Object)
    at org.apache.jena.tdb.store.nodetable.NodeTableCache.getNodeForNodeId(NodeTableCache.java:82)
    at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeForNodeId(NodeTableWrapper.java:54)



—
Enrico Daga (enridaga)
http://www.enridaga.net
Il budda e’ nel parco.





> On 8 May 2017, at 13:46, Andy Seaborne <an...@apache.org> wrote:
> 
> Hi Enrico,
> 
> JENA-1224 was a different effect but might be a related.  It accounts for very log stacks.
> 
> It was addressed after Fuseki 2.3.1 - could it be possible for you to try current Fuseki?
> 
> In jstack, what is the thread holding the lock doing?
> 
> 	Andy
> 
> On 08/05/17 11:23, Enrico Daga (enridaga) wrote:
>> Good morning,
>> 
>> I have an instance of Fuseki 2.3.1 running in production that sometimes hangs, leaving a long set of CLOSE_WAIT connections with Apache (its proxy).
>> It looks like connections are left hanging ignoring the timeout in the configuration, therefore I need to shut down the VM, delete the lock files manually and restart.
>> However, this is happening quite often recently (probably because of an increase of activity).
>> Looking into it with jstack, I observed ~150 threads in BLOCKED state, all waiting to lock *the same* object.
>> Here is one:
>> 
>> "qtp2123914473-3049" #3049 prio=5 os_prio=0 tid=0x00007f1ae9909000 nid=0x5016 waiting for monitor entry [0x00007f15d7108000]
>>   java.lang.Thread.State: BLOCKED (on object monitor)
>>    at org.apache.jena.tdb.store.nodetable.NodeTableCache._idForNode(NodeTableCache.java:144)
>>    - waiting to lock <0x00000004c007ffa8> (a java.lang.Object)
>>    at org.apache.jena.tdb.store.nodetable.NodeTableCache.getNodeIdForNode(NodeTableCache.java:87)
>>    at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
>>    at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
>>    at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
>>    at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
>>    at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
>>    at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
>>    at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
>>    at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
>>    at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
>>    at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
>>    at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
>>    at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
>>    at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
>>    at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
>>    at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
>>    at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
>>    at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
>>    at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
>>    at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
>>    at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
>> […]
>> 
>> These three objects call each other for a while in the stack.
>> 
>> Looking at the issues, it might be similar to what observed here [1], although version 2.3.1 did not seem to be affected (BTW, the issue says FIXED but reading the comments it looks like the problem was not reproduced).
>> It looks like a deadlock, I was wondering whether anybody have seen this before?
>> 
>> Thank you for any feedback,
>> 
>> Enrico
>> 
>> 
>> [1] https://issues.apache.org/jira/browse/JENA-1296
>> 
>> 
>> —
>> Enrico Daga (enridaga)
>> http://www.enridaga.net
>> Il budda e’ nel parco.
>> 
>> 
>> 
>> 
>> 


Re: Fuseki/TDB stuck: ~150 threads BLOCKED waiting to lock the same object

Posted by Andy Seaborne <an...@apache.org>.
Hi Enrico,

JENA-1224 was a different effect but might be a related.  It accounts 
for very log stacks.

It was addressed after Fuseki 2.3.1 - could it be possible for you to 
try current Fuseki?

In jstack, what is the thread holding the lock doing?

	Andy

On 08/05/17 11:23, Enrico Daga (enridaga) wrote:
> Good morning,
>
> I have an instance of Fuseki 2.3.1 running in production that sometimes hangs, leaving a long set of CLOSE_WAIT connections with Apache (its proxy).
> It looks like connections are left hanging ignoring the timeout in the configuration, therefore I need to shut down the VM, delete the lock files manually and restart.
> However, this is happening quite often recently (probably because of an increase of activity).
> Looking into it with jstack, I observed ~150 threads in BLOCKED state, all waiting to lock *the same* object.
> Here is one:
>
> "qtp2123914473-3049" #3049 prio=5 os_prio=0 tid=0x00007f1ae9909000 nid=0x5016 waiting for monitor entry [0x00007f15d7108000]
>    java.lang.Thread.State: BLOCKED (on object monitor)
>     at org.apache.jena.tdb.store.nodetable.NodeTableCache._idForNode(NodeTableCache.java:144)
>     - waiting to lock <0x00000004c007ffa8> (a java.lang.Object)
>     at org.apache.jena.tdb.store.nodetable.NodeTableCache.getNodeIdForNode(NodeTableCache.java:87)
>     at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
>     at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
>     at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
>     at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
>     at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
>     at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
>     at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
>     at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
>     at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
>     at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
>     at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
>     at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
>     at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
>     at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
>     at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
>     at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
>     at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
>     at org.apache.jena.tdb.transaction.NodeTableTrans.getNodeIdForNode(NodeTableTrans.java:98)
>     at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeIdForNode(NodeTableWrapper.java:48)
>     at org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeIdForNode(NodeTableInline.java:59)
> […]
>
> These three objects call each other for a while in the stack.
>
> Looking at the issues, it might be similar to what observed here [1], although version 2.3.1 did not seem to be affected (BTW, the issue says FIXED but reading the comments it looks like the problem was not reproduced).
> It looks like a deadlock, I was wondering whether anybody have seen this before?
>
> Thank you for any feedback,
>
> Enrico
>
>
> [1] https://issues.apache.org/jira/browse/JENA-1296
>
>
> —
> Enrico Daga (enridaga)
> http://www.enridaga.net
> Il budda e’ nel parco.
>
>
>
>
>