ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Artem Shutak (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IGNITE-1022) Next scenario hangs
Date Tue, 16 Jun 2015 16:32:01 GMT
Artem Shutak created IGNITE-1022:
------------------------------------

             Summary: Next scenario hangs
                 Key: IGNITE-1022
                 URL: https://issues.apache.org/jira/browse/IGNITE-1022
             Project: Ignite
          Issue Type: Bug
            Reporter: Artem Shutak
            Assignee: Semen Boikov
             Fix For: sprint-7


There are 2 nodes: one node broadcast closures, second node always restarts.

It hangs on some iteration.

{code}
public class MyTest extends GridCommonAbstractTest {
    /**
     * @throws Exception If failed.
     */
    public void testName() throws Exception {
        Thread thread = null;
        Ignite ignite = null;

        final CountDownLatch testEndedLatch = new CountDownLatch(1);

        try {
            ignite = startGrid("mainGrid");

            thread = new Thread(new Runnable() {
                @Override public void run() {
                    try {
                        for (int i = 0; i < 100; i++) {
                            try (Ignite ignored = startGrid("startedGrid")) {
                                Thread.sleep(1000);
                            }
                        }
                    }
                    catch (Exception e) {
                        // Do nothing.
                    }
                    finally {
                        testEndedLatch.countDown();
                    }
                }
            });

            thread.start();

            while (testEndedLatch.getCount() > 0) {
                try {
                    ignite.compute().broadcast(new IgniteClosure<Set, Integer>() {
                        @Override public Integer apply(Set set) {
                            System.out.println("Hellow world!");

                            return 1;
                        }
                    }, ignite.set("set", new CollectionConfiguration()));
                }
                catch (IgniteException e) {
                    // Do nothing.
                }
            }
        }
        finally {
            assert testEndedLatch.await(30, TimeUnit.SECONDS);

            if (thread != null)
                thread.join();

            if (ignite != null)
                ignite.close();
        }
    }
}
{code}

Stack trace of thread in waiting.
{noformat}
"ignite-#10%pub-mainGrid%@1659" prio=5 tid=0x17 nid=NA waiting
  java.lang.Thread.State: WAITING
	  at sun.misc.Unsafe.park(Unsafe.java:-1)
	  at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
	  at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:834)
	  at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:994)
	  at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1303)
	  at org.apache.ignite.internal.util.future.GridFutureAdapter.get(GridFutureAdapter.java:115)
	  at org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.getAndPutIfAbsent(GridDhtAtomicCache.java:345)
	  at org.apache.ignite.internal.processors.cache.datastructures.CacheDataStructuresManager$2.call(CacheDataStructuresManager.java:510)
	  at org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor.retry(DataStructuresProcessor.java:1243)
	  at org.apache.ignite.internal.processors.cache.datastructures.CacheDataStructuresManager.retryPutIfAbsent(CacheDataStructuresManager.java:508)
	  at org.apache.ignite.internal.processors.cache.datastructures.CacheDataStructuresManager.set0(CacheDataStructuresManager.java:321)
	  at org.apache.ignite.internal.processors.cache.datastructures.CacheDataStructuresManager.set(CacheDataStructuresManager.java:293)
	  at org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$17.applyx(DataStructuresProcessor.java:1187)
	  at org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$17.applyx(DataStructuresProcessor.java:1185)
	  at org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$13.call(DataStructuresProcessor.java:881)
	  at org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6124)
	  at org.apache.ignite.internal.processors.closure.GridClosureProcessor$2.body(GridClosureProcessor.java:893)
	  at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:108)
	  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	  at java.lang.Thread.run(Thread.java:745)
{noformat}



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

Mime
View raw message