Uploaded image for project: 'Hot Rod Native client'
  1. Hot Rod Native client
  2. HRCPP-416

Continuous query listener does not handle expired entries

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • None
    • 8.1.1.Final
    • .NET
    • None

    Description

      The following code fails because the LeavingCallback is not called even though the entry is correctly expired (removed):

      [Test]
              public void ExpirationContQueryTest()
              {
                  int joined = 0, updated = 0, left = 0;
                  bool receivedSignal = false;
                  IRemoteCache<int, User> userCache = remoteManager.GetCache<int, User>(NAMED_CACHE);
                  try
                  {
                      userCache.Clear();
                      Semaphore s = new Semaphore(0, 1);
                      QueryRequest qr = new QueryRequest();
                      qr.QueryString = "from sample_bank_account.User";
                      Event.ContinuousQueryListener<int, User> cql = new Event.ContinuousQueryListener<int, User>(qr.QueryString);
                      cql.JoiningCallback = (int k, User v) => { joined++; };
                      cql.LeavingCallback = (int k, User v) => { left++; s.Release(); };
                      cql.UpdatedCallback = (int k, User v) => { updated++; };
                      userCache.AddContinuousQueryListener(cql);
                      User u1 = CreateUser1(userCache);
                      userCache.Put(1, u1, 200, TimeUnit.MILLISECONDS);
                      receivedSignal = s.WaitOne(10000);
                      userCache.RemoveContinuousQueryListener(cql);
                      userCache.Clear();
                  }
                  catch (System.Exception ex)
                  {
                      Console.WriteLine(ex.Message);
                  }
                  Assert.IsNull(userCache.Get(1));
                  Assert.IsTrue(receivedSignal, "Timed out waiting for left members");
      //^^^ fails here --------
                  Assert.AreEqual(1, joined, "Joined counter failure");
                  Assert.AreEqual(0, updated, "Updated counter failure");
                  Assert.AreEqual(1, left, "Left counter failure");
              }
      

      Attachments

        Activity

          People

            vrigamon@redhat.com Vittorio Rigamonti
            mgencur Martin Gencur
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: