ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dkarachentsev <dkarachent...@gridgain.com>
Subject Re: Node hangs while accessing cache from Compute Task
Date Thu, 16 Feb 2017 11:16:24 GMT

This is a correct behavior. It's not allowed to use cache API in
CacheEntryProcessor, query listeners, interceptors and so forth, because it
leads to deadlocks. In your example it looks like (threads T1, T2):
T1 put entry -> T1 lock entry -> T1 call listener -> T1 execute job -> T1
wait for result -> T2 get entry -> T2 try to lock entry -> T2 BLOCKED by T1

@IgniteAsyncCallback is a legal way to resolve such situations. In your case
it will be:
T1 put entry -> T1 lock entry -> T1 submit listener to callback pool -> T1
unlock entry.
T3 - callback thread.
T3 execute job -> T3 wait for result -> T2 get entry -> T2 lock entry -> T2
unlock entry -> T2 return compute result -> T3 release with result.

No deadlocks now.


View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Node-hangs-while-accessing-cache-from-Compute-Task-tp10637p10668.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

View raw message