You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2021/04/30 23:21:07 UTC

[GitHub] [geode] nabarunnag commented on a change in pull request #6417: GEODE-9138: Moved debug log message and added tests

nabarunnag commented on a change in pull request #6417:
URL: https://github.com/apache/geode/pull/6417#discussion_r624288654



##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/event/DistributedEventTracker.java
##########
@@ -363,11 +370,27 @@ public boolean hasSeenEvent(EventID eventID, InternalCacheEvent tagHolder) {
       if (evh.isRemoved() || evh.getLastSequenceNumber() < eventID.getSequenceID()) {
         return false;
       }
-      if (shouldLogPreviouslySeenEvent(tagHolder, evh)) {
+      Pair<Boolean, String> shouldLogPreviouslySeenEvent =
+          shouldLogPreviouslySeenEvent(tagHolder, evh);
+      if (shouldLogPreviouslySeenEvent.getLeft()) {
         logger.info(EVENT_HAS_PREVIOUSLY_BEEN_SEEN, region.getName(),
             tagHolder == null ? "unknown" : ((EntryEventImpl) tagHolder).getKey(),
             tagHolder == null ? "unknown" : tagHolder.getOperation(), eventID.expensiveToString(),
             evh.getLastSequenceNumber());
+      } else {
+        if (logger.isDebugEnabled()) {
+          if (tagHolder == null) {
+            logger.debug(IGNORING_PREVIOUSLY_SEEN_EVENT_PREFIX,
+                shouldLogPreviouslySeenEvent.getRight());
+          } else {
+            logger.debug(IGNORING_PREVIOUSLY_SEEN_EVENT, shouldLogPreviouslySeenEvent.getRight(),
+                region.getName(), ((EntryEventImpl) tagHolder).getKey(), tagHolder.getOperation(),
+                tagHolder.getEventId().expensiveToString(), evh.getLastSequenceNumber());
+          }
+          logger.warn(IGNORING_PREVIOUSLY_SEEN_EVENT, shouldLogPreviouslySeenEvent.getRight(),

Review comment:
       Removing the warn section may resolve this issue.
   Currently  if tagHolder=null , it will cause an NPE in the logger.warn message




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org