Hello!
1) I think it's Public thread. I think your solution should be OK.
2) Right. When you would listen on this future? I hope it isn't in Event
listener :)
Regards,
--
Ilya Kasnacheev
пн, 28 янв. 2019 г. в 17:15, Humphrey :
> Hi Ilya,
>
> 1) Which thread pool is used by compute? (is that
Hi Ilya,
1) Which thread pool is used by compute? (is that the ignite public thread
pool [1])?
I'm now using the following from when I listen to events:
CompletableFuture.runAsync(() -> {
ignite.compute().run(new MyRunnable(event.getValue()))
}, Executors.newFixedThreadPool(10));
This
Hello!
It may work due to a pure chance and then eventually lock.
Actually putAsync will execute synchronously if executed on data node (for
a given key). It is recommended to avoid any cache operations from event
listeners. In Event Listener you can put data to queue, and dequeue it in a
Thread [name="sys-stripe-1-#2", id=17, state=WAITING, blockCnt=8, waitCnt=8]
Lock [object=java.util.concurrent.Semaphore$NonfairSync@6915e1ad,
ownerName=null, ownerId=-1]
at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
And can you also clarify which thread pool is used for cache.put() /
cache.putAsync ?
I'm getting a lock whit two nodes when putting data into the cache with
map.forEach((key, value) -> cache.putAsync(key, value));
I could also try putAllAsync() but don't know if that is better than
putAsync.
Thanks Ilya,
It works with runAsync.
(Question) Can you clarify why does it work on a single node well and when
going on two nodes it doesn't, and we get the exceptions? I was expecting it
also to be happening on one server node.
Humphrey
--
Sent from:
Hello!
As a general principle you should avoid doing any blocking operations from
event handlers, which is precisely something that you are doing.
If you replace run() with runAsync() in your service impl, it will finish
all right with two ServerNode's.
Regards,
--
Ilya Kasnacheev
ср, 23
Hello everyone,
I'm getting the error below when running more than 1 ServerNode.
The idea what we want to achive is the following:
1) A client node will be adding data (ALPHA) to a partitioned cache
(CACHE_ALPHA).
2) In the cluster (server nodes) we have a Node-Singleton Service deployed,
which