You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/03/06 10:24:00 UTC

[jira] [Commented] (IGNITE-7845) Data race on atomicLong close

    [ https://issues.apache.org/jira/browse/IGNITE-7845?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16387571#comment-16387571 ] 

ASF GitHub Bot commented on IGNITE-7845:
----------------------------------------

GitHub user akalash opened a pull request:

    https://github.com/apache/ignite/pull/3606

    IGNITE-7845 fix checking atomicLong in IgniteClientDataStructuresTest…

    …#testAtomicLong.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/gridgain/apache-ignite ignite-7845

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/ignite/pull/3606.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3606
    
----
commit 514de7920e5ee7c7d3d83d1687de71d664e72028
Author: Anton Kalashnikov <ka...@...>
Date:   2018-03-06T10:22:37Z

    IGNITE-7845 fix checking atomicLong in IgniteClientDataStructuresTest#testAtomicLong.

----


> Data race on atomicLong close
> -----------------------------
>
>                 Key: IGNITE-7845
>                 URL: https://issues.apache.org/jira/browse/IGNITE-7845
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Anton Kalashnikov
>            Assignee: Anton Kalashnikov
>            Priority: Major
>              Labels: MakeTeamcityGreenAgain
>
> Found by IgniteClientDataStructuresTest.testAtomicLong.
> *Given:*
> IgniteAtomicLong was created e.g. atomicLong = ignite.atomicLong("long1", 1L, true)
> *When:*
> IgniteAtomicLong was closed e.g. atomicLong.close()
> *Then:*
> If you try to get this value again sometimes you will get null IgniteAtomicLong value and sometimes you will get not null IgniteAtomicLong value e.g. ignite.atomicLong("long1", 1L, false) sometimes null, sometimes not null
> But if we will get not null value IgniteAtomicLong and we will call method "get" on it, we will have one of two exception IllegalStateException("Sequence was removed from cache: " + name) if it already marked as deleted, and IgniteException("Failed to find atomic long: " + name) if it sill no marked as deleted but already deleted from cache.
> *Expected:*
> IgniteAtomicLong value always should be null(or not?)
> *Why it's happend:*
> When we close IgniteAtomicLong we removing value from cache in transaction but removing from internal storage(dsMap) happen asynchroniously in DataStructuresEntryListener for all nodes include local node. And when we try get value after close we still sometimes able to get IgniteAtomicLong from internal local storage.
> *Solution(In my opinion):*
> I guess in common case we don't  need call Ignite#atomicLong  every time when we need value, but we should use IgniteAtomicLong object received after first call. And if it is true, we can remove receiving IgniteAtomicLong from local storage(dsMap) - this changes will fix problem



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)