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 2016/01/27 18:44:39 UTC

[jira] [Commented] (IGNITE-2465) Assertion in load cache closure

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

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

GitHub user ashutakGG opened a pull request:

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

    IGNITE-2465: Assertion in load cache closure (a race fixed)

    https://issues.apache.org/jira/browse/IGNITE-2465.

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

    $ git pull https://github.com/ashutakGG/incubator-ignite ignite-2465-closure

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

    https://github.com/apache/ignite/pull/431.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 #431
    
----
commit 77894309934ee062d7b6459b1aae7618d2dc441f
Author: ashutak <as...@gridgain.com>
Date:   2016-01-27T15:11:50Z

    ignite-2465: add test

commit a7f53fef46f538de10119699212f35b1259f1f4d
Author: ashutak <as...@gridgain.com>
Date:   2016-01-27T17:36:46Z

    ignite-2465: fix

commit c736aaba062e9b6794d0ccba7e565428e31e5e17
Author: ashutak <as...@gridgain.com>
Date:   2016-01-27T17:39:18Z

    ignite-2465: revert test changes

----


> Assertion in load cache closure
> -------------------------------
>
>                 Key: IGNITE-2465
>                 URL: https://issues.apache.org/jira/browse/IGNITE-2465
>             Project: Ignite
>          Issue Type: Bug
>          Components: cache
>    Affects Versions: 1.5.0.final
>            Reporter: Denis Magda
>            Assignee: Artem Shutak
>            Priority: Blocker
>              Labels: important
>             Fix For: 1.6
>
>
> This is a tricky one. Every once in a while I get an assertion exception due to a null cache instance. It's difficult to reproduce, but the reason is more or less clear.
> First, here's the sequence of events:
> 1) node N0 starts a cache with GridGain's LocalCacheStore configured (see the cache config below).
> 2) also, N0 registers a listener for the Ignite DISCO_EVENTS.
> 3) node N1 joins the cluster.
> 4) N0 receives a discovery event (EVT_NODE_JOINED) and triggers cache loading using IgniteCache.loadCache(null).
> 5) N1 throws an AssertionException due to Ignite.cache("persistent-cache") call returning a null.
> From the log snippet below you can see that the exception is first reported and then a millisecond later GridCacheProcessor reports that the cache was started. This means that the cache load closure starts executing on node N1 a bit too early while the cache is still being started. I believe Ignite must be able to handle such race properly.
> {noformat}
> 9319 [pub-#212%N1%] ERROR GridJobWorker - Failed to execute job due to unexpected runtime exception [jobId=0af5bad7251-9f7af4ba-6a64-4de4-b5d2-81d59be05303, ses=GridJobSessionImpl [ses=GridTaskSessionImpl [taskName=o.a.i.i.processors.cache.GridCacheAdapter$LoadCacheClosure, dep=LocalDeployment [super=GridDeployment [ts=1453807336443, depMode=SHARED, clsLdr=sun.misc.Launcher$AppClassLoader@15db9742, clsLdrId=46f5bad7251-9f7af4ba-6a64-4de4-b5d2-81d59be05303, userVer=0, loc=true, sampleClsName=java.lang.String, pendingUndeploy=false, undeployed=false, usage=0]], taskClsName=o.a.i.i.processors.cache.GridCacheAdapter$LoadCacheClosure, sesId=e9f5bad7251-1edbab1e-37bf-424e-a9e1-0c866b95009d, startTime=1453807336874, endTime=9223372036854775807, taskNodeId=1edbab1e-37bf-424e-a9e1-0c866b95009d, clsLdr=sun.misc.Launcher$AppClassLoader@15db9742, closed=false, cpSpi=null, failSpi=null, loadSpi=null, usage=1, fullSup=false, subjId=1edbab1e-37bf-424e-a9e1-0c866b95009d, mapFut=IgniteFuture [orig=GridFutureAdapter [resFlag=0, res=null, startTime=1453807336894, endTime=0, ignoreInterrupts=false, lsnr=null, state=INIT]]], jobId=0af5bad7251-9f7af4ba-6a64-4de4-b5d2-81d59be05303]]
> java.lang.AssertionError: persistent-cache
> at org.apache.ignite.internal.processors.cache.GridCacheAdapter$LoadCacheClosure.call(GridCacheAdapter.java:5788)
> at org.apache.ignite.internal.processors.cache.GridCacheAdapter$LoadCacheClosure.call(GridCacheAdapter.java:5740)
> at org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2.execute(GridClosureProcessor.java:1789)
> at org.apache.ignite.internal.processors.job.GridJobWorker$2.call(GridJobWorker.java:509)
> at org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6397)
> at org.apache.ignite.internal.processors.job.GridJobWorker.execute0(GridJobWorker.java:503)
> at org.apache.ignite.internal.processors.job.GridJobWorker.body(GridJobWorker.java:456)
> at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
> at org.apache.ignite.internal.processors.job.GridJobProcessor.processJobExecuteRequest(GridJobProcessor.java:1166)
> at org.apache.ignite.internal.processors.job.GridJobProcessor$JobExecutionListener.onMessage(GridJobProcessor.java:1770)
> at org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:821)
> at org.apache.ignite.internal.managers.communication.GridIoManager.access$1600(GridIoManager.java:103)
> at org.apache.ignite.internal.managers.communication.GridIoManager$5.run(GridIoManager.java:784)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> 9320 [Thread-19] INFO GridCacheProcessor - Started cache [name=persistent-cache, mode=REPLICATED]
> {noformat}
> For reference, here's the code that configures the cache:
> {noformat}
> CacheConfiguration<K, V> config = new CacheConfiguration<>("persistent-cache");
> config.setCacheMode(CacheMode.REPLICATED);
> config.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
> config.setRebalanceMode(CacheRebalanceMode.SYNC);
> config.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
> config.setStartSize(1024);
> config.setCacheStoreFactory(new LocalCacheStoreFactory(somepath));
> config.setWriteThrough(true);
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)