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/04/19 13:14:00 UTC

[jira] [Commented] (IGNITE-8092) Put operation may hang if cache was destroyed asynchronously.

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

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

GitHub user xtern opened a pull request:

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

    IGNITE-8092 Put hang on destroy.

    

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

    $ git pull https://github.com/xtern/ignite IGNITE-8092

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

    https://github.com/apache/ignite/pull/3876.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 #3876
    
----
commit 14c62b87992013faf849d9d39f4a7bf9f0bdd715
Author: pereslegin-pa <xx...@...>
Date:   2018-04-19T13:06:59Z

    IGNITE-8092 Put hang on destroy.

----


> Put operation may hang if cache was destroyed asynchronously.
> -------------------------------------------------------------
>
>                 Key: IGNITE-8092
>                 URL: https://issues.apache.org/jira/browse/IGNITE-8092
>             Project: Ignite
>          Issue Type: Bug
>          Components: cache
>    Affects Versions: 2.4
>            Reporter: Pavel Pereslegin
>            Assignee: Pavel Pereslegin
>            Priority: Major
>
> If there is more than one cache in the cache group then put operation on cache may hang if it was destroyed asynchronously.
> For now this applies to all cache modes (PARTITIONED/REPLICATED/LOCAL) and to all atomicity modes (ATOMIC/TRANSACTIONAL).
> This problem can not be reproduced if there is only one cache in the cache group.
> Reproducer:
> {code:java}
> public class DestroyCacheTest extends GridCommonAbstractTest {
>     private CacheConfiguration<Integer, Boolean> ccfg(String name, String grp) {
>         return new CacheConfiguration<Integer, Boolean>(name).setCacheMode(CacheMode.PARTITIONED)
>             .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)
>             .setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC)
>             .setGroupName(grp);
>     }
>     public void testDestroyAsync() throws Exception {
>         String grpName = "testGroup";
>         try (IgniteEx node = startGrid(0)) {
>             node.createCache(ccfg("cache2", grpName));
>             for (int n = 0; n < 100; n++) {
>                 IgniteCache<Integer, Boolean> cache1 = node.createCache(ccfg("cache1", grpName));
>                 AtomicInteger cntr = new AtomicInteger();
>                 GridTestUtils.runMultiThreadedAsync(() -> {
>                     try {
>                         int key;
>                         while ((key = cntr.getAndIncrement()) < 10_000) {
>                             if (key == 1000)
>                                 cache1.destroy();
>                             cache1.putIfAbsent(key, true);
>                         }
>                     }
>                     catch (Exception ignore) {
>                         log.warning(ignore.getMessage());
>                     }
>                     return null;
>                 }, 6, "put-thread").get();
>             }
>         }
>     }
> }
> {code}
> p.s. for ATOMIC cache additional cache status check in GridCacheGateway#onStopped busy wait resolve this problem.



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