Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-7466

HARegionQueueTest queuePutElidesSequenceIdLowerThanOrEqualToLastSeenSequenceId can throw a NullPointerException if the CacheClientNotifier instance is set

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.12.0
    • tests
    • None

    Description

      Testing has shown this NPE can occur:

      java.lang.NullPointerException
          at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936)
          at org.apache.geode.internal.cache.tier.sockets.CacheClientNotifier.getClientProxy(CacheClientNotifier.java:1197)
          at org.apache.geode.internal.cache.ha.HARegionQueue$DispatchedAndCurrentEvents.putObject(HARegionQueue.java:3023)
          at org.apache.geode.internal.cache.ha.HARegionQueue.basicPut(HARegionQueue.java:679)
          at org.apache.geode.internal.cache.ha.HARegionQueue.put(HARegionQueue.java:631)
          at org.apache.geode.internal.cache.ha.HARegionQueueTest.queuePutElidesSequenceIdLowerThanOrEqualToLastSeenSequenceId(HARegionQueueTest.java:119)
      

      HARegionQueue.java:3023 is here:

                                  CacheClientNotifier ccn = CacheClientNotifier.getInstance();
                                  if (ccn != null) {
      HARegionQueue.java:3023 ->    ccn.getClientProxy(owningQueue.clientProxyID).getStatistics().incMessagesFailedQueued();
                                  }
      

      The HARegionQueueTest does not create a CacheClientNotifier, so it seems like its created in another test and that test affects this one.

      If a CacheClientNotifier is created in this test, then the same NPE is thrown because owningQueue.clientProxyID is null.

      Attachments

        Issue Links

          Activity

            People

              echobravo Ernest Burghardt
              boglesby Barrett Oglesby
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h