You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Sergey Kozlov (JIRA)" <ji...@apache.org> on 2015/03/18 20:45:38 UTC

[jira] [Created] (IGNITE-508) Loop of start/stop cache fails

Sergey Kozlov created IGNITE-508:
------------------------------------

             Summary: Loop of start/stop cache fails
                 Key: IGNITE-508
                 URL: https://issues.apache.org/jira/browse/IGNITE-508
             Project: Ignite
          Issue Type: Bug
    Affects Versions: sprint-2
            Reporter: Sergey Kozlov
            Assignee: Alexey Goncharuk
             Fix For: sprint-3


I modified CachePutGetExample by following way:

{code:title=CachePutGetExample.java|borderStyle=solid}
public static void main(String[] args) throws IgniteException {
    try (Ignite ignite = Ignition.start("examples/config/example-compute.xml")) {

        CacheConfiguration<Integer, String> cfg = new CacheConfiguration<>();

        cfg.setCacheMode(CacheMode.PARTITIONED);
        cfg.setName(CACHE_NAME);

        for (int i=0; i < 1000; i++) {
            System.out.println("Iteration " + Integer.toString(i));
            try (IgniteCache<Integer, String> cache = ignite.createCache(cfg)) {
                // Individual puts and gets.
                putGet(cache);

                // Bulk puts and gets.
                putAllGetAll(cache);
            }
        }
    }
}
{code}

The example fails after at iteration 272:
{noformat}
Iteration 273
[22:41:41,998][INFO ][exchange-worker-#49%null%][GridCacheProcessor] Started cache [name=CachePutGetExample, mode=PARTITIONED]
[22:41:42,091][INFO ][exchange-worker-#49%null%][GridDhtPreloader] <CachePutGetExample> Starting rebalancing in ASYNC mode: CachePutGetExample

>>> Cache put-get example started.
>>> Stored values in cache.
Got [key=0, val=0]

>>> Starting putAll-getAll example.
>>> Bulk-stored values in cache.
Got entry [key=0, val=bulk-0]
[22:41:42,093][INFO ][preloader-demand-worker-#1434%null%][GridDhtPreloader] <CachePutGetExample> Completed rebalancing in ASYNC mode [cache=CachePutGetExample, time=0 ms]
[22:41:42,096][INFO ][exchange-worker-#49%null%][GridCacheProcessor] Stopped cache: CachePutGetExample
Iteration 274
[22:41:42,104][INFO ][main][GridTcpRestProtocol] Command protocol successfully stopped: TCP binary
[22:41:42,132][INFO ][main][GridCacheProcessor] Stopped cache: ignite-marshaller-sys-cache
[22:41:42,132][INFO ][main][GridCacheProcessor] Stopped cache: ignite-sys-cache
[22:41:42,132][INFO ][main][GridCacheProcessor] Stopped cache: ignite-atomics-sys-cache
[22:41:42,139][INFO ][main][IgniteKernal] 

>>> +----------------------------------------------------------------------------------------------+
>>> Ignite ver. 1.0.0-RC3-SNAPSHOT#20150318-sha1:8c082029ab28b08402c0c8663fc90b8497315a5d stopped OK
>>> +----------------------------------------------------------------------------------------------+
>>> Grid name: null
>>> Grid uptime: 00:00:16:163


Exception in thread "main" javax.cache.CacheException: class org.apache.ignite.IgniteCheckedException: Failed to start cache (a cache with the same name is already being started or stopped): CachePutGetExample
	at org.apache.ignite.internal.processors.cache.GridCacheUtils.convertToCacheException(GridCacheUtils.java:1812)
	at org.apache.ignite.internal.IgniteKernal.createCache(IgniteKernal.java:2265)
	at org.apache.ignite.examples.datagrid.CachePutGetExample.main(CachePutGetExample.java:56)
	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:483)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to start cache (a cache with the same name is already being started or stopped): CachePutGetExample
	at org.apache.ignite.internal.processors.cache.GridCacheProcessor.initiateCacheChanges(GridCacheProcessor.java:1631)
	at org.apache.ignite.internal.processors.cache.GridCacheProcessor.dynamicStartCache(GridCacheProcessor.java:1582)
	at org.apache.ignite.internal.IgniteKernal.createCache(IgniteKernal.java:2260)
	... 6 more

Process finished with exit code 1
{noformat}



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