[
https://issues.apache.org/jira/browse/IGNITE-5960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16505887#comment-16505887
]
Alexey Goncharuk commented on IGNITE-5960:
------------------------------------------
[~Alexey Kuznetsov] If I understand correctly, in your last case the user will
be notified with entry E2, but since the listeners map is re-acquired after the
{{needVal}} flag evaluation, the event notification may see incorrect previous
value. Also note that other methods such as {{innerSet}} and {{innerRemove}}
also suffer from this race.
I like the solution suggested by [~sunnychanclsa] better, because it linearizes
entry update and CQ registration.
[~sunnychanclsa], would you mind pulling master to your PR (there are some
conflicts due to changes related to Java 9 compatibility) and replacing the
{{ReentrantReadWriteLock}} with {{StripedCompositeReadWriteLock}} to reduce
contention because these updates are on a hot path? After this, we will need to
run a benchmark to verify there are no performance regression.
> Ignite Continuous Query (Queries 3):
> CacheContinuousQueryConcurrentPartitionUpdateTest::testConcurrentUpdatesAndQueryStartAtomic
> is flaky
> -----------------------------------------------------------------------------------------------------------------------------------------
>
> Key: IGNITE-5960
> URL: https://issues.apache.org/jira/browse/IGNITE-5960
> Project: Ignite
> Issue Type: Bug
> Affects Versions: 2.1
> Reporter: Sergey Chugunov
> Assignee: Alexey Kuznetsov
> Priority: Major
> Labels: MakeTeamcityGreenAgain, test-failure
> Fix For: 2.6
>
>
> According to [TC
> history|http://ci.ignite.apache.org/project.html?projectId=Ignite20Tests&testNameId=6546112007182082024&tab=testDetails&branch_Ignite20Tests=%3Cdefault%3E]
> test is flaky.
> It is possible to reproduce it locally, sample run shows 9 failed tests out
> of 30 overall executed.
> Test fails with jUnit assertion check:
> {noformat}
> junit.framework.AssertionFailedError:
> Expected :10000
> Actual :0
> <Click to see difference>
> at junit.framework.Assert.fail(Assert.java:57)
> at junit.framework.Assert.failNotEquals(Assert.java:329)
> at junit.framework.Assert.assertEquals(Assert.java:78)
> at junit.framework.Assert.assertEquals(Assert.java:234)
> at junit.framework.Assert.assertEquals(Assert.java:241)
> at junit.framework.TestCase.assertEquals(TestCase.java:409)
> at
> org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryConcurrentPartitionUpdateTest.concurrentUpdatesAndQueryStart(CacheContinuousQueryConcurrentPartitionUpdateTest.java:385)
> at
> org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryConcurrentPartitionUpdateTest.testConcurrentUpdatesAndQueryStartTx(CacheContinuousQueryConcurrentPartitionUpdateTest.java:245)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at junit.framework.TestCase.runTest(TestCase.java:176)
> at
> org.apache.ignite.testframework.junits.GridAbstractTest.runTestInternal(GridAbstractTest.java:2000)
> at
> org.apache.ignite.testframework.junits.GridAbstractTest.access$000(GridAbstractTest.java:132)
> at
> org.apache.ignite.testframework.junits.GridAbstractTest$5.run(GridAbstractTest.java:1915)
> at java.lang.Thread.run(Thread.java:745)
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)