ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Павлухин Иван <vololo...@gmail.com>
Subject Re: DeadLocked while calling .Net ThinClient PutAll ?
Date Mon, 18 Mar 2019 06:12:58 GMT
Hi,

When you are working with TRANSACTIONAL cache you should be aware that
deadlocks might happen. I see the following options to prevent
deadlocks to happen:
1. Explicitly order all keys involved in any transaction using the
same comparator.
2. Use OPTIMISTIC transactions.

Also, in many databases deadlocks can happen as well. So, instead of
preventing deadlocks it is quite common to provide some means of
breaking them. In Ignite it is possible to configure a transaction
timeout. In that case deadlocked transaction will be aborted sooner or
later and another transaction will be able to make a progress.

> Should it be handle natively in Ignite Core, shouldn't it ?

Unfortunately there is no general way to prevent deadlocks when using
PutAll with unordered collection. Ignite does not enforce all keys to
be Comparable which means that there could be keys without defined
consistent order. And if we cannot order keys consistently then we can
catch a deadlock.

пн, 18 мар. 2019 г. в 05:53, Tâm Nguyễn Mạnh <nguyenmanhtam123@gmail.com>:
>
> Hi Igniters,
>
> I heard that It could lead to DeadLocked when I pass non sorted collection
> into putAll method. Is it true ?
>
> From document i see that method requires a IEnumerable<KeyValuePair<TK,
> TV>> as input. I think pass a sorted collection into API is just a
> workaround way. Should it be handle natively in Ignite Core, shouldn't it ?
>
> How do you thing ?
>
> --
> Thanks & Best Regards
>
> Tam, Nguyen Manh



-- 
Best regards,
Ivan Pavlukhin

Mime
View raw message