Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-9128

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.6
    • None
    • cache
    • None
    • Docs Required

    Description

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

      Reproducer shows resource leak:

      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.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();
              }
          }
      }
      

      Output:

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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              xtern Pavel Pereslegin
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: