[jira] [Created] (IGNITE-9128) Continuous query handlers don't clean up after cache was stopped.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (IGNITE-9128) Continuous query handlers don't clean up after cache was stopped.

Anton Vinogradov (Jira)
Pavel Pereslegin created IGNITE-9128:
----------------------------------------

             Summary: Continuous query handlers don't clean up after cache was stopped.
                 Key: IGNITE-9128
                 URL: https://issues.apache.org/jira/browse/IGNITE-9128
             Project: Ignite
          Issue Type: Bug
          Components: cache
    Affects Versions: 2.6
            Reporter: Pavel Pereslegin


Continuous query handlers don't clean up after the cache was stopped.

Reproducer shows resource leak:
{code:java}
public class Reproducer extends GridCommonAbstractTest {
    /** */
    private static final String CACHE1 = "cache1";

    /** */
    public void testCacheRecreate() throws Exception {
        IgniteEx node = startGrid(0);

        int hndCntr = 0;

        try {
            for (int i = 0; i < 100; i++) {
                IgniteCache<Integer, Integer> cache = node.createCache(CACHE1);

                cache.query(new ContinuousQuery<>().setLocalListener(evts -> {}));

                cache.put(1, 1);

                cache.destroy();
            }

            for (Object locInfo : ((Map)U.field(node.context().continuous(), "locInfos")).values()) {
                GridContinuousHandler hnd = U.field(locInfo, "hnd");

                if (CACHE1.equals(hnd.cacheName()))
                    ++hndCntr;
            }

            assertEquals("No local handlers expected after cache was stopped.", 0, hndCntr);
        }
        finally {
            stopAllGrids();
        }
    }
}
{code}

Output:
{noformat}
junit.framework.AssertionFailedError: No local handlers expected after cache was stopped.
Expected :0
Actual   :100
{noformat}




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