ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkulichenko <valentin.kuliche...@gmail.com>
Subject Re: Problem with cache expiry and lock
Date Thu, 31 Dec 2015 21:52:32 GMT
Hi Kevin,

The event listener is called from the synchronized block on entry, so there
is no reason to use explicit lock there - the key is already locked. And
actually since you're locking the same key, this code should not deadlock
(and it works for me). Probably the issue is caused by some commented out
code inside the critical sections.

But in general, I would not recommend to execute any synchronous cache
operations or acquire locks inside the listener, because it's indeed
deadlock-prone and also can affect performance. If you want to update the
cache after the expiration happened, you should do this asynchronously,
without blocking the thread that called the listener.

Hope this helps.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Problem-with-cache-expiry-and-lock-tp2363p2365.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message