geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [geode] branch develop updated: GEODE-5963: Change destroy no entry found log statement to debug (#2756)
Date Mon, 05 Nov 2018 17:13:39 GMT
This is an automated email from the ASF dual-hosted git repository.

klund pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 887c0a6  GEODE-5963: Change destroy no entry found log statement to debug (#2756)
887c0a6 is described below

commit 887c0a6a0ee2a62d6a90db00d2a3d803256ff30d
Author: Kirk Lund <klund@apache.org>
AuthorDate: Mon Nov 5 09:13:29 2018 -0800

    GEODE-5963: Change destroy no entry found log statement to debug (#2756)
    
    Also fixed new Object[] mistake in log statement in Destroy65
    that was introduced by changes for GEODE-5686.
---
 .../geode/internal/cache/tier/sockets/command/Destroy.java   |  6 ++++--
 .../geode/internal/cache/tier/sockets/command/Destroy65.java |  6 ++++--
 .../internal/cache/tier/sockets/command/Destroy65Test.java   | 12 ++++++++++++
 .../internal/cache/tier/sockets/command/DestroyTest.java     | 12 ++++++++++++
 4 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/Destroy.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/Destroy.java
index 0857a31..1603f18 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/Destroy.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/Destroy.java
@@ -153,8 +153,10 @@ public class Destroy extends BaseCommand {
     } catch (EntryNotFoundException e) {
       // Don't send an exception back to the client if this
       // exception happens. Just log it and continue.
-      logger.info("{}: during entry destroy no entry was found for key {}",
-          serverConnection.getName(), key);
+      if (logger.isDebugEnabled()) {
+        logger.debug("{}: during entry destroy no entry was found for key {}",
+            serverConnection.getName(), key);
+      }
     } catch (RegionDestroyedException rde) {
       writeException(clientMessage, rde, false, serverConnection);
       serverConnection.setAsTrue(RESPONDED);
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/Destroy65.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/Destroy65.java
index 5f7166a..708d8b9 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/Destroy65.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/Destroy65.java
@@ -281,8 +281,10 @@ public class Destroy65 extends BaseCommand {
     } catch (EntryNotFoundException e) {
       // Don't send an exception back to the client if this
       // exception happens. Just log it and continue.
-      logger.info("{}: during entry destroy no entry was found for key {}",
-          new Object[] {serverConnection.getName(), key});
+      if (logger.isDebugEnabled()) {
+        logger.debug("{}: during entry destroy no entry was found for key {}",
+            serverConnection.getName(), key);
+      }
       entryNotFoundForRemove = true;
     } catch (RegionDestroyedException rde) {
       writeException(clientMessage, rde, false, serverConnection);
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Destroy65Test.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Destroy65Test.java
index 68315ab..b9c40bc 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Destroy65Test.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Destroy65Test.java
@@ -14,6 +14,9 @@
  */
 package org.apache.geode.internal.cache.tier.sockets.command;
 
+import static org.assertj.core.api.Assertions.assertThatCode;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
 import static org.mockito.ArgumentMatchers.isA;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.doThrow;
@@ -29,6 +32,7 @@ import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 
 import org.apache.geode.CancelCriterion;
+import org.apache.geode.cache.EntryNotFoundException;
 import org.apache.geode.cache.operations.DestroyOperationContext;
 import org.apache.geode.internal.Version;
 import org.apache.geode.internal.cache.InternalCache;
@@ -176,4 +180,12 @@ public class Destroy65Test {
     verify(this.errorResponseMessage).send(eq(this.serverConnection));
   }
 
+  @Test
+  public void destroyThrowsAndHandlesEntryNotFoundExceptionOnServer() {
+    doThrow(new EntryNotFoundException("")).when(region).basicBridgeDestroy(any(), any(),
any(),
+        anyBoolean(), any());
+
+    assertThatCode(() -> destroy65.cmdExecute(message, serverConnection, securityService,
0))
+        .doesNotThrowAnyException();
+  }
 }
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/DestroyTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/DestroyTest.java
index 13ed684..ac3572d 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/DestroyTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/DestroyTest.java
@@ -14,6 +14,9 @@
  */
 package org.apache.geode.internal.cache.tier.sockets.command;
 
+import static org.assertj.core.api.Assertions.assertThatCode;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
 import static org.mockito.ArgumentMatchers.isA;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.doThrow;
@@ -29,6 +32,7 @@ import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 
 import org.apache.geode.CancelCriterion;
+import org.apache.geode.cache.EntryNotFoundException;
 import org.apache.geode.cache.operations.DestroyOperationContext;
 import org.apache.geode.internal.Version;
 import org.apache.geode.internal.cache.InternalCache;
@@ -179,4 +183,12 @@ public class DestroyTest {
     verify(this.errorResponseMessage).send(eq(this.serverConnection));
   }
 
+  @Test
+  public void destroyThrowsAndHandlesEntryNotFoundExceptionOnServer() {
+    doThrow(new EntryNotFoundException("")).when(region).basicBridgeDestroy(any(), any(),
any(),
+        anyBoolean(), any());
+
+    assertThatCode(() -> destroy.cmdExecute(message, serverConnection, securityService,
0))
+        .doesNotThrowAnyException();
+  }
 }


Mime
View raw message