[infinispan-issues] [JBoss JIRA] (ISPN-2491) Order of locks in optimistic locking is not strict
Dan Berindei (JIRA)
issues at jboss.org
Thu Feb 1 02:46:00 EST 2018
[ https://issues.jboss.org/browse/ISPN-2491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13527032#comment-13527032 ]
Dan Berindei commented on ISPN-2491:
------------------------------------
[~rvansa] I think this issue was meant to cover transactions that modify the same keys but in a different order. {{Collections.sort()}} is guaranteed to be stable, so transactions that touch the same sets of keys in the same order always worked.
> Order of locks in optimistic locking is not strict
> --------------------------------------------------
>
> Key: ISPN-2491
> URL: https://issues.jboss.org/browse/ISPN-2491
> Project: Infinispan
> Issue Type: Quality Risk
> Components: Transactions
> Affects Versions: 5.1.8.Final, 5.2.0.Beta3
> Reporter: Radim Vansa
> Priority: Minor
>
> In OptimisticLockingInterceptor, the keys are ordered according to their hash. However, the hashes can still collide, which may result in a deadlock if two keys with identical hash (only 32-bit) are sorted to different order. We should try to check if the keys are Comparable or let user provide some comparator class in config, and use the compare of hash only as the last resort.
> In all cases, a warning should be emitted if the compare operation had non-strict result.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
More information about the infinispan-issues
mailing list