[ 
https://issues.apache.org/jira/browse/IGNITE-7892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16389144#comment-16389144
 ] 

Alexander Belyak commented on IGNITE-7892:
------------------------------------------

hanged thread stack example
{noformat}
"grid-timeout-worker-#119%DPL_GRID%DplGridNodeName%" #276 daemon prio=5 
os_prio=0 tid=0x00007efee5ba8000 nid=0xd707 waiting on condition 
[0x00007efd7c5c5000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00007f0182815ad8> (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.ignite.internal.processors.cache.GridCacheMapEntry.lockEntry(GridCacheMapEntry.java:4195)
        at 
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCacheEntry.toString(GridDhtCacheEntry.java:815)
        at java.lang.String.valueOf(String.java:2994)
        at 
org.apache.ignite.internal.util.GridStringBuilder.a(GridStringBuilder.java:101)
        at 
org.apache.ignite.internal.util.tostring.SBLimitedLength.a(SBLimitedLength.java:88)
        at 
org.apache.ignite.internal.util.tostring.GridToStringBuilder.toString(GridToStringBuilder.java:939)
        at 
org.apache.ignite.internal.util.tostring.GridToStringBuilder.toStringImpl(GridToStringBuilder.java:1005)
        at 
org.apache.ignite.internal.util.tostring.GridToStringBuilder.toString(GridToStringBuilder.java:826)
        at 
org.apache.ignite.internal.util.tostring.GridToStringBuilder.toString(GridToStringBuilder.java:783)
        at 
org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry.toString(IgniteTxEntry.java:1267)
        at java.lang.String.valueOf(String.java:2994)
        at java.lang.StringBuilder.append(StringBuilder.java:131)
        at java.util.AbstractCollection.toString(AbstractCollection.java:462)
        at java.lang.String.valueOf(String.java:2994)
        at 
org.apache.ignite.internal.util.GridStringBuilder.a(GridStringBuilder.java:101)
        at 
org.apache.ignite.internal.util.tostring.SBLimitedLength.a(SBLimitedLength.java:88)
        at 
org.apache.ignite.internal.util.tostring.GridToStringBuilder.toString(GridToStringBuilder.java:939)
        at 
org.apache.ignite.internal.util.tostring.GridToStringBuilder.toString(GridToStringBuilder.java:897)
        at 
org.apache.ignite.internal.util.tostring.GridToStringBuilder.appendVals(GridToStringBuilder.java:1718)
        at 
org.apache.ignite.internal.util.tostring.GridToStringBuilder.toStringImpl(GridToStringBuilder.java:1008)
        at 
org.apache.ignite.internal.util.tostring.GridToStringBuilder.toString(GridToStringBuilder.java:826)
        at 
org.apache.ignite.internal.util.tostring.GridToStringBuilder.toString(GridToStringBuilder.java:783)
        at 
org.apache.ignite.internal.processors.cache.transactions.IgniteTxStateImpl.toString(IgniteTxStateImpl.java:466)
        at java.lang.String.valueOf(String.java:2994)
        at 
org.apache.ignite.internal.util.GridStringBuilder.a(GridStringBuilder.java:101)
        at 
org.apache.ignite.internal.util.tostring.SBLimitedLength.a(SBLimitedLength.java:88)
        at 
org.apache.ignite.internal.util.tostring.GridToStringBuilder.toString(GridToStringBuilder.java:939)
        at 
org.apache.ignite.internal.util.tostring.GridToStringBuilder.toStringImpl(GridToStringBuilder.java:1005)
        at 
org.apache.ignite.internal.util.tostring.GridToStringBuilder.toString(GridToStringBuilder.java:762)
        at 
org.apache.ignite.internal.util.tostring.GridToStringBuilder.toString(GridToStringBuilder.java:710)
        at 
org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalAdapter.toString(IgniteTxLocalAdapter.java:1452)
        at 
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxLocalAdapter.toString(GridDhtTxLocalAdapter.java:850)
        at 
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxLocal.toString(GridDhtTxLocal.java:619)
        at java.lang.String.valueOf(String.java:2994)
        at java.lang.StringBuilder.append(StringBuilder.java:131)
        at 
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager.dumpLongRunningOperations0(GridCachePartitionExchangeManager.java:1644)
        at 
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager.dumpLongRunningOperations(GridCachePartitionExchangeManager.java:1706)
        at org.apache.ignite.internal.IgniteKernal$4.run(IgniteKernal.java:1256)
        at 
org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor$CancelableTask.onTimeout(GridTimeoutProcessor.java:261)
        - locked <0x00007f00ebf90098> (a 
org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor$CancelableTask)
        at 
org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor$TimeoutWorker.body(GridTimeoutProcessor.java:163)
        at 
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
        at java.lang.Thread.run(Thread.java:745)

   Locked ownable synchronizers:
        - None
{noformat}


> Remove aquirence of any locks from toString methods
> ---------------------------------------------------
>
>                 Key: IGNITE-7892
>                 URL: https://issues.apache.org/jira/browse/IGNITE-7892
>             Project: Ignite
>          Issue Type: Wish
>          Components: general
>    Affects Versions: 2.4
>            Reporter: Alexander Belyak
>            Priority: Minor
>
> In org.apache.ignite.internal.processors.cache.GridCacheMapEntry we have 
> thread safe toString() method that can lead to some hangs of monitoring 
> threads like grid-timeout-worker if we try to dump LongRunningOperations with 
> locked entry.
> I think that toString methods will never need to be a thread safe and can 
> throw ConcurrentModificationException or print inconsistent data, so we must 
> remove synchronization from every toString methods in codebase. If we need 
> some "consistent" string representation - let's add consistentToString 
> methods or do external synchronization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to