Re: Cannot start/stop cache within lock or transaction

2017-09-20 Thread Anton Vinogradov
Hi All. I've updated reproducer and provided some investigation results at issue. On Fri, Sep 15, 2017 at 7:12 PM, rajivgandhi wrote: > Hi Yakov, > The test will pass if you comment the line: > "IgniteCache cache3 = >

Re: Cannot start/stop cache within lock or transaction

2017-09-15 Thread rajivgandhi
Hi Yakov, The test will pass if you comment the line: "IgniteCache cache3 = ignite.getOrCreateCache(getConfig(*"cache3"*));" Question is why is creation of cache3 causing deadlock? Please note: 1. Lock is being acquired on cache2 2. clear is being called on cache1 The error

Re: Cannot start/stop cache within lock or transaction

2017-09-15 Thread naresh.goty
yakov - I just looked the code, and it clearly shows that lock is on item in cache2, where as cache.clear() is performed for cach1. The real issue here is creation of new cache(cache3) is causing deadlock when there is a lock on items in other cache. -Naresh -- Sent from:

Re: Cannot start/stop cache within lock or transaction

2017-09-15 Thread Yakov Zhdanov
I see that you call cache.clear() after acquiring explicit lock on key "fake". This cause cache clear to hang and this in turn prevents lock.unlock() call. Explicit lock also holds the exchange process. If I comment out cache.clear() test passes without deadlock. --Yakov

Re: Cannot start/stop cache within lock or transaction

2017-09-15 Thread Yakov Zhdanov
Thanks, we'll take a look! --Yakov

Re: Cannot start/stop cache within lock or transaction

2017-09-14 Thread rajivgandhi
The issue cannot be reproduced in 1.4.0. It seems the bug was introduced in 1.5.0 -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Cannot start/stop cache within lock or transaction

2017-09-14 Thread rajivgandhi
Hi Yakov, This is pretty easy to repro. Please find attached the source code project which reproduces this 100% of the time. If you could please suggest a workaround or time line for the fix. thanks and Regards, Rajeev ignite-deadlock.zip

Re: Cannot start/stop cache within lock or transaction

2017-09-14 Thread Yakov Zhdanov
Naresh, The case you described should work. Can you please create a reproducer that I can run locally? I also filed this to make best effort to avoid deadlocks - https://issues.apache.org/jira/browse/IGNITE-6380 --Yakov

Re: Cannot start/stop cache within lock or transaction

2017-09-13 Thread naresh.goty
Val, JMX console is not detecting deadlocks, but the threads are on indefinite wait. Scenario: Similar to scenario provided below by rajivgandhi: Use case: 1. Thread 1 creates (getorcreate) Cache1 2. Thread 1 acquires a lock on item1 in Cache3 (different cache) 3. Thread 2 creates Ignite

Re: Cannot start/stop cache within lock or transaction

2017-09-13 Thread vkulichenko
getOrCreateCache can cause deadlock only under certain circumstances, in which we throw an exception for this particular reason. Scenarios you describe should not cause a deadlock, please attach thread dumps from all the nodes if you believe you have one. -Val -- Sent from:

Re: Cannot start/stop cache within lock or transaction

2017-09-13 Thread naresh.goty
One more symptom: If 2 or more threads are calling getOrCreate concurrently, it is deadlocking the threads. -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Cannot start/stop cache within lock or transaction

2017-09-13 Thread naresh.goty
Frankly, I am quite perplexed that the simplest of the API (getOrCreate) can potentially deadlock the application. 1. Can you please tell me how to use Locks then? If an application has a need to create a cache and it has a need to use Lock/unlock block, if the getOrCreate happens to occur in one

Re: Cannot start/stop cache within lock or transaction

2017-09-13 Thread naresh.goty
In our case, cache 2 is not part of the transaction in thread 1 (which uses only cache 2). Why should Thread 2 be affected by a transaction in thread 1 when they are working with different caches? -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Cannot start/stop cache within lock or transaction

2017-09-12 Thread vkulichenko
Naresh, This is correct behavior. Creation of new cache triggers global exchange process which can't be done concurrently with transactions, so if you create a cache synchronously within a transaction, you would create a deadlock. You should create all caches required for a transaction prior to

Cannot start/stop cache within lock or transaction

2017-09-12 Thread naresh.goty
Hi All, We are encountering the below problem during application startup configured with Ignite 2.1.0 Error: "Cannot start/stop cache within lock or transaction" Use case: 1. Thread 1 creates (getorcreate) Cache1 2. Thread 1 acquires a lock on item1 in Cache1 3. Thread 2 crea