This is an automated email from the ASF dual-hosted git repository.

bschuchardt 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 dec2cfe  GEODE-4377: Don't catch encoding exceptions in 
OperationHandlers
dec2cfe is described below

commit dec2cfe1e650d5adcfd41ecabe9b0c9a3f3dc91f
Author: Bruce Schuchardt <bschucha...@pivotal.io>
AuthorDate: Wed Feb 14 11:33:10 2018 -0800

    GEODE-4377: Don't catch encoding exceptions in OperationHandlers
    
    This adds DecodingException and moves the handling of EncodingException
    and this new exception to ProtobufOpsProcessor.
    
    I've also added tests for getAll and putAll to ensure that their
    handlers properly process all entries in the presence of a Key or
    Entry decoding error.
    
    This closes #1434
---
 .../operations/ProtobufOperationHandler.java       |  6 ++-
 .../protocol/protobuf/v1/ProtobufOpsProcessor.java |  6 ++-
 .../protobuf/v1/ProtobufSerializationService.java  |  5 +-
 .../AbstractFunctionRequestOperationHandler.java   | 11 +++--
 ...cuteFunctionOnGroupRequestOperationHandler.java | 21 ++------
 ...uteFunctionOnMemberRequestOperationHandler.java |  6 +--
 ...uteFunctionOnRegionRequestOperationHandler.java |  8 ++--
 .../operations/GetAllRequestOperationHandler.java  | 56 +++++++++++-----------
 .../GetRegionNamesRequestOperationHandler.java     |  2 +
 .../GetRegionRequestOperationHandler.java          |  2 +
 .../v1/operations/GetRequestOperationHandler.java  | 13 ++---
 .../v1/operations/GetServerOperationHandler.java   |  2 +
 .../operations/PutAllRequestOperationHandler.java  | 53 +++++++++++---------
 .../v1/operations/PutRequestOperationHandler.java  | 11 +++--
 .../operations/RemoveRequestOperationHandler.java  | 10 ++--
 .../AuthenticationRequestOperationHandler.java     |  6 +--
 .../v1/serialization/JsonPdxConverter.java         |  5 +-
 .../v1/serialization/SerializationService.java     |  3 +-
 .../protobuf/v1/serialization/TypeConverter.java   |  3 +-
 ...codingException.java => DecodingException.java} |  6 +--
 .../serialization/exception/EncodingException.java |  2 +-
 .../v1/utilities/ProtobufResponseUtilities.java    | 13 +++++
 .../v1/ExecuteFunctionOnMemberIntegrationTest.java |  5 --
 .../v1/acceptance/CacheOperationsJUnitTest.java    | 14 +++++-
 .../GetAllRequestOperationHandlerJUnitTest.java    | 44 +++++++++++++++++
 .../GetRequestOperationHandlerJUnitTest.java       | 17 +++----
 .../PutAllRequestOperationHandlerJUnitTest.java    | 48 ++++++++++++++++---
 .../PutRequestOperationHandlerJUnitTest.java       | 14 ++----
 .../RemoveRequestOperationHandlerJUnitTest.java    | 14 ++----
 .../v1/utilities/ProtobufUtilitiesJUnitTest.java   | 14 ++++--
 30 files changed, 260 insertions(+), 160 deletions(-)

diff --git 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/operations/ProtobufOperationHandler.java
 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/operations/ProtobufOperationHandler.java
index 799278c..a093aaf 100644
--- 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/operations/ProtobufOperationHandler.java
+++ 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/operations/ProtobufOperationHandler.java
@@ -19,6 +19,8 @@ import 
org.apache.geode.internal.protocol.protobuf.v1.ClientProtocol;
 import org.apache.geode.internal.protocol.protobuf.v1.MessageExecutionContext;
 import 
org.apache.geode.internal.protocol.protobuf.v1.ProtobufSerializationService;
 import org.apache.geode.internal.protocol.protobuf.v1.Result;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.state.exception.ConnectionStateException;
 
 /**
@@ -38,6 +40,6 @@ public interface ProtobufOperationHandler<Req, Resp> {
    */
   Result<Resp, ClientProtocol.ErrorResponse> process(
       ProtobufSerializationService serializationService, Req request,
-      MessageExecutionContext messageExecutionContext)
-      throws InvalidExecutionContextException, ConnectionStateException;
+      MessageExecutionContext messageExecutionContext) throws 
InvalidExecutionContextException,
+      ConnectionStateException, EncodingException, DecodingException;
 }
diff --git 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/ProtobufOpsProcessor.java
 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/ProtobufOpsProcessor.java
index 794f22b..ff1aa1d 100644
--- 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/ProtobufOpsProcessor.java
+++ 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/ProtobufOpsProcessor.java
@@ -20,6 +20,8 @@ import org.apache.geode.annotations.Experimental;
 import org.apache.geode.internal.exception.InvalidExecutionContextException;
 import org.apache.geode.internal.logging.LogService;
 import 
org.apache.geode.internal.protocol.protobuf.v1.registry.ProtobufOperationContextRegistry;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.state.ProtobufConnectionTerminatingStateProcessor;
 import 
org.apache.geode.internal.protocol.protobuf.v1.state.exception.ConnectionStateException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.state.exception.OperationNotAuthorizedException;
@@ -58,7 +60,7 @@ public class ProtobufOpsProcessor {
       // Don't move to a terminating state for authorization state failures
       logger.warn(e.getMessage());
       result = Failure.of(ProtobufResponseUtilities.makeErrorResponse(e));
-    } catch (ConnectionStateException e) {
+    } catch (EncodingException | DecodingException | ConnectionStateException 
e) {
       logger.warn(e.getMessage());
       messageExecutionContext
           .setConnectionStateProcessor(new 
ProtobufConnectionTerminatingStateProcessor());
@@ -71,7 +73,7 @@ public class ProtobufOpsProcessor {
 
   private Result processOperation(ClientProtocol.Message request, 
MessageExecutionContext context,
       ClientProtocol.Message.MessageTypeCase requestType, 
ProtobufOperationContext operationContext)
-      throws ConnectionStateException {
+      throws ConnectionStateException, EncodingException, DecodingException {
     try {
       return 
operationContext.getOperationHandler().process(serializationService,
           operationContext.getFromRequest().apply(request), context);
diff --git 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/ProtobufSerializationService.java
 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/ProtobufSerializationService.java
index 5442776..33a42aa 100644
--- 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/ProtobufSerializationService.java
+++ 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/ProtobufSerializationService.java
@@ -19,6 +19,7 @@ import com.google.protobuf.ByteString;
 import org.apache.geode.annotations.Experimental;
 import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.JsonPdxConverter;
 import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.SerializationService;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.utilities.exception.UnknownProtobufEncodingType;
 import org.apache.geode.pdx.PdxInstance;
@@ -98,7 +99,7 @@ public class ProtobufSerializationService implements 
SerializationService<BasicT
    * @throws EncodingException if the value cannot be decoded.
    */
   @Override
-  public Object decode(BasicTypes.EncodedValue encodedValue) throws 
EncodingException {
+  public Object decode(BasicTypes.EncodedValue encodedValue) throws 
DecodingException {
     switch (encodedValue.getValueCase()) {
       case BINARYRESULT:
         return encodedValue.getBinaryResult().toByteArray();
@@ -123,7 +124,7 @@ public class ProtobufSerializationService implements 
SerializationService<BasicT
       case VALUE_NOT_SET:
         return null;
       default:
-        throw new EncodingException(
+        throw new DecodingException(
             "Unknown Protobuf encoding type: " + encodedValue.getValueCase());
     }
   }
diff --git 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/AbstractFunctionRequestOperationHandler.java
 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/AbstractFunctionRequestOperationHandler.java
index ceff45c..5fe8c1b 100644
--- 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/AbstractFunctionRequestOperationHandler.java
+++ 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/AbstractFunctionRequestOperationHandler.java
@@ -17,8 +17,6 @@ package 
org.apache.geode.internal.protocol.protobuf.v1.operations;
 import java.util.List;
 import java.util.Set;
 
-import com.google.protobuf.AbstractMessage;
-
 import org.apache.geode.cache.execute.Execution;
 import org.apache.geode.cache.execute.Function;
 import org.apache.geode.cache.execute.FunctionException;
@@ -33,6 +31,7 @@ import org.apache.geode.internal.protocol.protobuf.v1.Failure;
 import org.apache.geode.internal.protocol.protobuf.v1.MessageExecutionContext;
 import 
org.apache.geode.internal.protocol.protobuf.v1.ProtobufSerializationService;
 import org.apache.geode.internal.protocol.protobuf.v1.Result;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
 import org.apache.geode.internal.security.SecurityService;
 import org.apache.geode.security.NotAuthorizedException;
@@ -44,7 +43,8 @@ public abstract class 
AbstractFunctionRequestOperationHandler<Req, Resp>
   @Override
   public Result<Resp, ClientProtocol.ErrorResponse> process(
       ProtobufSerializationService serializationService, Req request,
-      MessageExecutionContext messageExecutionContext) throws 
InvalidExecutionContextException {
+      MessageExecutionContext messageExecutionContext)
+      throws InvalidExecutionContextException, DecodingException {
 
     final String functionID = getFunctionID(request);
 
@@ -115,7 +115,7 @@ public abstract class 
AbstractFunctionRequestOperationHandler<Req, Resp>
   }
 
   protected abstract Set<?> parseFilter(ProtobufSerializationService 
serializationService,
-      Req request) throws EncodingException;
+      Req request) throws EncodingException, DecodingException;
 
   protected abstract String getFunctionID(Req request);
 
@@ -128,7 +128,8 @@ public abstract class 
AbstractFunctionRequestOperationHandler<Req, Resp>
 
   /** arguments for the function */
   protected abstract Object getFunctionArguments(Req request,
-      ProtobufSerializationService serializationService) throws 
EncodingException;
+      ProtobufSerializationService serializationService)
+      throws EncodingException, DecodingException;
 
   protected abstract Execution getFunctionExecutionObject(Object 
executionTarget)
       throws InvalidExecutionContextException;
diff --git 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/ExecuteFunctionOnGroupRequestOperationHandler.java
 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/ExecuteFunctionOnGroupRequestOperationHandler.java
index b6a4573..5a2841b 100644
--- 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/ExecuteFunctionOnGroupRequestOperationHandler.java
+++ 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/ExecuteFunctionOnGroupRequestOperationHandler.java
@@ -23,7 +23,6 @@ import org.apache.geode.cache.execute.Execution;
 import org.apache.geode.cache.execute.FunctionService;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.internal.exception.InvalidExecutionContextException;
-import org.apache.geode.internal.protocol.operations.ProtobufOperationHandler;
 import org.apache.geode.internal.protocol.protobuf.v1.BasicTypes;
 import org.apache.geode.internal.protocol.protobuf.v1.ClientProtocol;
 import org.apache.geode.internal.protocol.protobuf.v1.Failure;
@@ -33,6 +32,7 @@ import 
org.apache.geode.internal.protocol.protobuf.v1.MessageExecutionContext;
 import 
org.apache.geode.internal.protocol.protobuf.v1.ProtobufSerializationService;
 import org.apache.geode.internal.protocol.protobuf.v1.Result;
 import org.apache.geode.internal.protocol.protobuf.v1.Success;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
 
 public class ExecuteFunctionOnGroupRequestOperationHandler extends
@@ -40,17 +40,8 @@ public class ExecuteFunctionOnGroupRequestOperationHandler 
extends
 
 
   @Override
-  public Result<ExecuteFunctionOnGroupResponse, ClientProtocol.ErrorResponse> 
process(
-      ProtobufSerializationService serializationService, 
ExecuteFunctionOnGroupRequest request,
-      MessageExecutionContext messageExecutionContext) throws 
InvalidExecutionContextException {
-
-    return (Result<ExecuteFunctionOnGroupResponse, 
ClientProtocol.ErrorResponse>) super.process(
-        serializationService, request, messageExecutionContext);
-  }
-
-  @Override
   protected Set<?> parseFilter(ProtobufSerializationService 
serializationService,
-      ExecuteFunctionOnGroupRequest request) throws EncodingException {
+      ExecuteFunctionOnGroupRequest request) {
     // filters are not allowed on functions not associated with regions
     return null;
   }
@@ -98,13 +89,12 @@ public class ExecuteFunctionOnGroupRequestOperationHandler 
extends
 
   @Override
   protected Object getFunctionArguments(ExecuteFunctionOnGroupRequest request,
-      ProtobufSerializationService serializationService) throws 
EncodingException {
+      ProtobufSerializationService serializationService) throws 
DecodingException {
     return serializationService.decode(request.getArguments());
   }
 
   @Override
-  protected Execution getFunctionExecutionObject(Object executionTarget)
-      throws InvalidExecutionContextException {
+  protected Execution getFunctionExecutionObject(Object executionTarget) {
     ProtocolStringList groupList = (ProtocolStringList) executionTarget;
     return FunctionService.onMember(groupList.toArray(new String[0]));
   }
@@ -121,8 +111,7 @@ public class ExecuteFunctionOnGroupRequestOperationHandler 
extends
   }
 
   @Override
-  protected Result buildResultMessage(ProtobufSerializationService 
serializationService)
-      throws EncodingException {
+  protected Result buildResultMessage(ProtobufSerializationService 
serializationService) {
     return Success.of(ExecuteFunctionOnGroupResponse.newBuilder().build());
   }
 
diff --git 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/ExecuteFunctionOnMemberRequestOperationHandler.java
 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/ExecuteFunctionOnMemberRequestOperationHandler.java
index 942e8b9..a0774d8 100644
--- 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/ExecuteFunctionOnMemberRequestOperationHandler.java
+++ 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/ExecuteFunctionOnMemberRequestOperationHandler.java
@@ -34,6 +34,7 @@ import 
org.apache.geode.internal.protocol.protobuf.v1.MessageExecutionContext;
 import 
org.apache.geode.internal.protocol.protobuf.v1.ProtobufSerializationService;
 import org.apache.geode.internal.protocol.protobuf.v1.Result;
 import org.apache.geode.internal.protocol.protobuf.v1.Success;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
 
 public class ExecuteFunctionOnMemberRequestOperationHandler extends
@@ -90,7 +91,7 @@ public class ExecuteFunctionOnMemberRequestOperationHandler 
extends
 
   @Override
   protected Object getFunctionArguments(ExecuteFunctionOnMemberRequest request,
-      ProtobufSerializationService serializationService) throws 
EncodingException {
+      ProtobufSerializationService serializationService) throws 
DecodingException {
     return serializationService.decode(request.getArguments());
   }
 
@@ -116,8 +117,7 @@ public class ExecuteFunctionOnMemberRequestOperationHandler 
extends
   }
 
   @Override
-  protected Result buildResultMessage(ProtobufSerializationService 
serializationService)
-      throws EncodingException {
+  protected Result buildResultMessage(ProtobufSerializationService 
serializationService) {
     return Success.of(ExecuteFunctionOnMemberResponse.newBuilder().build());
   }
 
diff --git 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/ExecuteFunctionOnRegionRequestOperationHandler.java
 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/ExecuteFunctionOnRegionRequestOperationHandler.java
index e20835a..1cb9100 100644
--- 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/ExecuteFunctionOnRegionRequestOperationHandler.java
+++ 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/ExecuteFunctionOnRegionRequestOperationHandler.java
@@ -31,13 +31,14 @@ import 
org.apache.geode.internal.protocol.protobuf.v1.MessageExecutionContext;
 import 
org.apache.geode.internal.protocol.protobuf.v1.ProtobufSerializationService;
 import org.apache.geode.internal.protocol.protobuf.v1.Result;
 import org.apache.geode.internal.protocol.protobuf.v1.Success;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
 
 public class ExecuteFunctionOnRegionRequestOperationHandler extends
     AbstractFunctionRequestOperationHandler<ExecuteFunctionOnRegionRequest, 
ExecuteFunctionOnRegionResponse> {
 
   protected Set<Object> parseFilter(ProtobufSerializationService 
serializationService,
-      ExecuteFunctionOnRegionRequest request) throws EncodingException {
+      ExecuteFunctionOnRegionRequest request) throws DecodingException {
     List<BasicTypes.EncodedValue> encodedFilter = request.getKeyFilterList();
     Set<Object> filter = new HashSet<>();
 
@@ -72,7 +73,7 @@ public class ExecuteFunctionOnRegionRequestOperationHandler 
extends
 
   @Override
   protected Object getFunctionArguments(ExecuteFunctionOnRegionRequest request,
-      ProtobufSerializationService serializationService) throws 
EncodingException {
+      ProtobufSerializationService serializationService) throws 
DecodingException {
     return serializationService.decode(request.getArguments());
   }
 
@@ -93,8 +94,7 @@ public class ExecuteFunctionOnRegionRequestOperationHandler 
extends
   }
 
   @Override
-  protected Result buildResultMessage(ProtobufSerializationService 
serializationService)
-      throws EncodingException {
+  protected Result buildResultMessage(ProtobufSerializationService 
serializationService) {
     return Success.of(ExecuteFunctionOnRegionResponse.newBuilder().build());
   }
 
diff --git 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetAllRequestOperationHandler.java
 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetAllRequestOperationHandler.java
index 20f1388..1d398b1 100644
--- 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetAllRequestOperationHandler.java
+++ 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetAllRequestOperationHandler.java
@@ -14,15 +14,13 @@
  */
 package org.apache.geode.internal.protocol.protobuf.v1.operations;
 
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
+import static 
org.apache.geode.internal.protocol.protobuf.v1.BasicTypes.ErrorCode.INVALID_REQUEST;
+import static 
org.apache.geode.internal.protocol.protobuf.v1.BasicTypes.ErrorCode.SERVER_ERROR;
 
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.annotations.Experimental;
 import org.apache.geode.cache.Region;
-import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.exception.InvalidExecutionContextException;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.protocol.operations.ProtobufOperationHandler;
@@ -34,6 +32,7 @@ import 
org.apache.geode.internal.protocol.protobuf.v1.ProtobufSerializationServi
 import org.apache.geode.internal.protocol.protobuf.v1.RegionAPI;
 import org.apache.geode.internal.protocol.protobuf.v1.Result;
 import org.apache.geode.internal.protocol.protobuf.v1.Success;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.utilities.ProtobufResponseUtilities;
 import 
org.apache.geode.internal.protocol.protobuf.v1.utilities.ProtobufUtilities;
@@ -46,7 +45,8 @@ public class GetAllRequestOperationHandler
   @Override
   public Result<RegionAPI.GetAllResponse, ClientProtocol.ErrorResponse> 
process(
       ProtobufSerializationService serializationService, 
RegionAPI.GetAllRequest request,
-      MessageExecutionContext messageExecutionContext) throws 
InvalidExecutionContextException {
+      MessageExecutionContext messageExecutionContext)
+      throws InvalidExecutionContextException, DecodingException {
     String regionName = request.getRegionName();
     Region region = messageExecutionContext.getCache().getRegion(regionName);
     if (region == null) {
@@ -56,49 +56,49 @@ public class GetAllRequestOperationHandler
     }
 
     long startTime = messageExecutionContext.getStatistics().startOperation();
-    Map<Boolean, List<Object>> resultsCollection;
+    RegionAPI.GetAllResponse.Builder responseBuilder = 
RegionAPI.GetAllResponse.newBuilder();
     try {
-      ((InternalCache) 
messageExecutionContext.getCache()).setReadSerializedForCurrentThread(true);
-
-      resultsCollection = request.getKeyList().stream()
-          .map((key) -> processOneMessage(serializationService, region, key))
-          .collect(Collectors.partitioningBy(x -> x instanceof 
BasicTypes.Entry));
+      
messageExecutionContext.getCache().setReadSerializedForCurrentThread(true);
+      request.getKeyList().stream()
+          .forEach((key) -> processSingleKey(responseBuilder, 
serializationService, region, key));
     } finally {
-      ((InternalCache) 
messageExecutionContext.getCache()).setReadSerializedForCurrentThread(false);
+      
messageExecutionContext.getCache().setReadSerializedForCurrentThread(false);
       messageExecutionContext.getStatistics().endOperation(startTime);
     }
-    RegionAPI.GetAllResponse.Builder responseBuilder = 
RegionAPI.GetAllResponse.newBuilder();
-
-    for (Object entry : resultsCollection.get(true)) {
-      responseBuilder.addEntries((BasicTypes.Entry) entry);
-    }
-
-    for (Object entry : resultsCollection.get(false)) {
-      responseBuilder.addFailures((BasicTypes.KeyedError) entry);
-    }
 
     return Success.of(responseBuilder.build());
   }
 
-  private Object processOneMessage(ProtobufSerializationService 
serializationService, Region region,
+  private void processSingleKey(RegionAPI.GetAllResponse.Builder 
responseBuilder,
+      ProtobufSerializationService serializationService, Region region,
       BasicTypes.EncodedValue key) {
     try {
+
       Object decodedKey = serializationService.decode(key);
       Object value = region.get(decodedKey);
-      return ProtobufUtilities.createEntry(serializationService, decodedKey, 
value);
+      BasicTypes.Entry entry =
+          ProtobufUtilities.createEntry(serializationService, decodedKey, 
value);
+      responseBuilder.addEntries(entry);
+
+    } catch (DecodingException ex) {
+      logger.info("Key encoding not supported: {}", ex);
+      responseBuilder
+          .addFailures(buildKeyedError(key, "Key encoding not supported.", 
INVALID_REQUEST));
     } catch (EncodingException ex) {
-      logger.error("Encoding not supported: {}", ex);
-      return createKeyedError(key, "Encoding not supported.", 
BasicTypes.ErrorCode.INVALID_REQUEST);
+      logger.info("Value encoding not supported: {}", ex);
+      responseBuilder
+          .addFailures(buildKeyedError(key, "Value encoding not supported.", 
INVALID_REQUEST));
     } catch (Exception ex) {
-      logger.error("Failure in protobuf getAll operation for key: " + key, ex);
-      return createKeyedError(key, ex.toString(), 
BasicTypes.ErrorCode.SERVER_ERROR);
+      logger.warn("Failure in protobuf getAll operation for key: " + key, ex);
+      responseBuilder.addFailures(buildKeyedError(key, ex.toString(), 
SERVER_ERROR));
     }
   }
 
-  private Object createKeyedError(BasicTypes.EncodedValue key, String 
errorMessage,
+  private BasicTypes.KeyedError buildKeyedError(BasicTypes.EncodedValue key, 
String errorMessage,
       BasicTypes.ErrorCode errorCode) {
     return BasicTypes.KeyedError.newBuilder().setKey(key)
         
.setError(BasicTypes.Error.newBuilder().setErrorCode(errorCode).setMessage(errorMessage))
         .build();
   }
+
 }
diff --git 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetRegionNamesRequestOperationHandler.java
 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetRegionNamesRequestOperationHandler.java
index 0b7c163..45ecc0c 100644
--- 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetRegionNamesRequestOperationHandler.java
+++ 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetRegionNamesRequestOperationHandler.java
@@ -26,6 +26,8 @@ import 
org.apache.geode.internal.protocol.protobuf.v1.ProtobufSerializationServi
 import org.apache.geode.internal.protocol.protobuf.v1.RegionAPI;
 import org.apache.geode.internal.protocol.protobuf.v1.Result;
 import org.apache.geode.internal.protocol.protobuf.v1.Success;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.utilities.ProtobufResponseUtilities;
 
 @Experimental
diff --git 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetRegionRequestOperationHandler.java
 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetRegionRequestOperationHandler.java
index 4027614..2c2bd17 100644
--- 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetRegionRequestOperationHandler.java
+++ 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetRegionRequestOperationHandler.java
@@ -29,6 +29,8 @@ import 
org.apache.geode.internal.protocol.protobuf.v1.ProtobufSerializationServi
 import org.apache.geode.internal.protocol.protobuf.v1.RegionAPI;
 import org.apache.geode.internal.protocol.protobuf.v1.Result;
 import org.apache.geode.internal.protocol.protobuf.v1.Success;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.utilities.ProtobufResponseUtilities;
 import 
org.apache.geode.internal.protocol.protobuf.v1.utilities.ProtobufUtilities;
 
diff --git 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetRequestOperationHandler.java
 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetRequestOperationHandler.java
index 5c2539e..162e3a7 100644
--- 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetRequestOperationHandler.java
+++ 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetRequestOperationHandler.java
@@ -18,7 +18,6 @@ import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.annotations.Experimental;
 import org.apache.geode.cache.Region;
-import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.exception.InvalidExecutionContextException;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.protocol.operations.ProtobufOperationHandler;
@@ -30,6 +29,7 @@ import 
org.apache.geode.internal.protocol.protobuf.v1.ProtobufSerializationServi
 import org.apache.geode.internal.protocol.protobuf.v1.RegionAPI;
 import org.apache.geode.internal.protocol.protobuf.v1.Result;
 import org.apache.geode.internal.protocol.protobuf.v1.Success;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.utilities.ProtobufResponseUtilities;
 
@@ -41,7 +41,8 @@ public class GetRequestOperationHandler
   @Override
   public Result<RegionAPI.GetResponse, ClientProtocol.ErrorResponse> process(
       ProtobufSerializationService serializationService, RegionAPI.GetRequest 
request,
-      MessageExecutionContext messageExecutionContext) throws 
InvalidExecutionContextException {
+      MessageExecutionContext messageExecutionContext)
+      throws InvalidExecutionContextException, EncodingException, 
DecodingException {
     String regionName = request.getRegionName();
     Region region = messageExecutionContext.getCache().getRegion(regionName);
     if (region == null) {
@@ -52,7 +53,7 @@ public class GetRequestOperationHandler
     long startOperationTime = 
messageExecutionContext.getStatistics().startOperation();
 
     try {
-      ((InternalCache) 
messageExecutionContext.getCache()).setReadSerializedForCurrentThread(true);
+      
messageExecutionContext.getCache().setReadSerializedForCurrentThread(true);
 
       Object decodedKey = serializationService.decode(request.getKey());
       Object resultValue = region.get(decodedKey);
@@ -63,12 +64,8 @@ public class GetRequestOperationHandler
 
       BasicTypes.EncodedValue encodedValue = 
serializationService.encode(resultValue);
       return 
Success.of(RegionAPI.GetResponse.newBuilder().setResult(encodedValue).build());
-    } catch (EncodingException ex) {
-      logger.error("Received Get request with unsupported encoding: {}", ex);
-      return Failure.of(ProtobufResponseUtilities
-          .makeErrorResponse(BasicTypes.ErrorCode.INVALID_REQUEST, "Encoding 
not supported."));
     } finally {
-      ((InternalCache) 
messageExecutionContext.getCache()).setReadSerializedForCurrentThread(false);
+      
messageExecutionContext.getCache().setReadSerializedForCurrentThread(false);
       messageExecutionContext.getStatistics().endOperation(startOperationTime);
     }
   }
diff --git 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetServerOperationHandler.java
 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetServerOperationHandler.java
index 865d540..873a85f 100644
--- 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetServerOperationHandler.java
+++ 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetServerOperationHandler.java
@@ -36,6 +36,8 @@ import 
org.apache.geode.internal.protocol.protobuf.v1.MessageExecutionContext;
 import 
org.apache.geode.internal.protocol.protobuf.v1.ProtobufSerializationService;
 import org.apache.geode.internal.protocol.protobuf.v1.Result;
 import org.apache.geode.internal.protocol.protobuf.v1.Success;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.state.ProtobufConnectionTerminatingStateProcessor;
 import 
org.apache.geode.internal.protocol.protobuf.v1.utilities.ProtobufResponseUtilities;
 
diff --git 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/PutAllRequestOperationHandler.java
 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/PutAllRequestOperationHandler.java
index 5749eb8..9d90aa3 100644
--- 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/PutAllRequestOperationHandler.java
+++ 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/PutAllRequestOperationHandler.java
@@ -14,8 +14,8 @@
  */
 package org.apache.geode.internal.protocol.protobuf.v1.operations;
 
-import java.util.Objects;
-import java.util.stream.Collectors;
+import static 
org.apache.geode.internal.protocol.protobuf.v1.BasicTypes.ErrorCode.INVALID_REQUEST;
+import static 
org.apache.geode.internal.protocol.protobuf.v1.BasicTypes.ErrorCode.SERVER_ERROR;
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
@@ -33,9 +33,8 @@ import 
org.apache.geode.internal.protocol.protobuf.v1.RegionAPI;
 import org.apache.geode.internal.protocol.protobuf.v1.Result;
 import org.apache.geode.internal.protocol.protobuf.v1.Success;
 import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.SerializationService;
-import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.utilities.ProtobufResponseUtilities;
-import 
org.apache.geode.internal.protocol.protobuf.v1.utilities.ProtobufUtilities;
 
 @Experimental
 public class PutAllRequestOperationHandler
@@ -45,7 +44,8 @@ public class PutAllRequestOperationHandler
   @Override
   public Result<RegionAPI.PutAllResponse, ClientProtocol.ErrorResponse> 
process(
       ProtobufSerializationService serializationService, 
RegionAPI.PutAllRequest putAllRequest,
-      MessageExecutionContext messageExecutionContext) throws 
InvalidExecutionContextException {
+      MessageExecutionContext messageExecutionContext)
+      throws InvalidExecutionContextException, DecodingException {
     String regionName = putAllRequest.getRegionName();
     Region region = messageExecutionContext.getCache().getRegion(regionName);
 
@@ -56,34 +56,41 @@ public class PutAllRequestOperationHandler
     }
 
     long startTime = messageExecutionContext.getStatistics().startOperation();
-    RegionAPI.PutAllResponse.Builder builder = 
RegionAPI.PutAllResponse.newBuilder()
-        .addAllFailedKeys(putAllRequest.getEntryList().stream()
-            .map((entry) -> singlePut(serializationService, region, 
entry)).filter(Objects::nonNull)
-            .collect(Collectors.toList()));
-    messageExecutionContext.getStatistics().endOperation(startTime);
+    RegionAPI.PutAllResponse.Builder builder = 
RegionAPI.PutAllResponse.newBuilder();
+    try {
+      
messageExecutionContext.getCache().setReadSerializedForCurrentThread(true);
+
+      putAllRequest.getEntryList().stream()
+          .forEach((entry) -> processSinglePut(builder, serializationService, 
region, entry));
+
+    } finally {
+      messageExecutionContext.getStatistics().endOperation(startTime);
+      
messageExecutionContext.getCache().setReadSerializedForCurrentThread(false);
+    }
     return Success.of(builder.build());
   }
 
-  private BasicTypes.KeyedError singlePut(SerializationService 
serializationService, Region region,
-      BasicTypes.Entry entry) {
+  private void processSinglePut(RegionAPI.PutAllResponse.Builder builder,
+      SerializationService serializationService, Region region, 
BasicTypes.Entry entry) {
     try {
-      Object decodedValue = serializationService.decode(entry.getValue());
-      Object decodedKey = serializationService.decode(entry.getKey());
 
+      Object decodedKey = serializationService.decode(entry.getKey());
+      Object decodedValue = serializationService.decode(entry.getValue());
       region.put(decodedKey, decodedValue);
-    } catch (EncodingException ex) {
-      return buildAndLogKeyedError(entry, BasicTypes.ErrorCode.INVALID_REQUEST,
-          "Encoding not supported", ex);
+
+    } catch (DecodingException ex) {
+      logger.info("Encoding not supported: " + ex);
+      builder.addFailedKeys(this.buildKeyedError(entry, INVALID_REQUEST, 
"Encoding not supported"));
     } catch (ClassCastException ex) {
-      return buildAndLogKeyedError(entry, BasicTypes.ErrorCode.SERVER_ERROR, 
ex.toString(), ex);
+      builder.addFailedKeys(buildKeyedError(entry, SERVER_ERROR, 
ex.toString()));
+    } catch (Exception ex) {
+      logger.warn("Error processing putAll entry", ex);
+      builder.addFailedKeys(buildKeyedError(entry, SERVER_ERROR, 
ex.toString()));
     }
-    return null;
   }
 
-  private BasicTypes.KeyedError buildAndLogKeyedError(BasicTypes.Entry entry,
-      BasicTypes.ErrorCode errorCode, String message, Exception ex) {
-    logger.error(message, ex);
-
+  private BasicTypes.KeyedError buildKeyedError(BasicTypes.Entry entry,
+      BasicTypes.ErrorCode errorCode, String message) {
     return BasicTypes.KeyedError.newBuilder().setKey(entry.getKey())
         
.setError(BasicTypes.Error.newBuilder().setErrorCode(errorCode).setMessage(message))
         .build();
diff --git 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/PutRequestOperationHandler.java
 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/PutRequestOperationHandler.java
index 5999c44..baf310f 100644
--- 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/PutRequestOperationHandler.java
+++ 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/PutRequestOperationHandler.java
@@ -14,6 +14,8 @@
  */
 package org.apache.geode.internal.protocol.protobuf.v1.operations;
 
+import static 
org.apache.geode.internal.protocol.protobuf.v1.BasicTypes.ErrorCode.SERVER_ERROR;
+
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.annotations.Experimental;
@@ -29,7 +31,9 @@ import 
org.apache.geode.internal.protocol.protobuf.v1.ProtobufSerializationServi
 import org.apache.geode.internal.protocol.protobuf.v1.RegionAPI;
 import org.apache.geode.internal.protocol.protobuf.v1.Result;
 import org.apache.geode.internal.protocol.protobuf.v1.Success;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
+import 
org.apache.geode.internal.protocol.protobuf.v1.state.exception.ConnectionStateException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.utilities.ProtobufResponseUtilities;
 
 @Experimental
@@ -40,7 +44,8 @@ public class PutRequestOperationHandler
   @Override
   public Result<RegionAPI.PutResponse, ClientProtocol.ErrorResponse> process(
       ProtobufSerializationService serializationService, RegionAPI.PutRequest 
request,
-      MessageExecutionContext messageExecutionContext) throws 
InvalidExecutionContextException {
+      MessageExecutionContext messageExecutionContext)
+      throws InvalidExecutionContextException, DecodingException {
     String regionName = request.getRegionName();
     Region region = messageExecutionContext.getCache().getRegion(regionName);
     if (region == null) {
@@ -64,10 +69,6 @@ public class PutRequestOperationHandler
         return Failure.of(ProtobufResponseUtilities
             .makeErrorResponse(BasicTypes.ErrorCode.SERVER_ERROR, 
ex.toString()));
       }
-    } catch (EncodingException ex) {
-      logger.error("Got error when decoding Put request: {}", ex);
-      return Failure.of(ProtobufResponseUtilities
-          .makeErrorResponse(BasicTypes.ErrorCode.INVALID_REQUEST, 
ex.toString()));
     } finally {
       messageExecutionContext.getStatistics().endOperation(startTime);
     }
diff --git 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/RemoveRequestOperationHandler.java
 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/RemoveRequestOperationHandler.java
index 1571a6c..88dee44 100644
--- 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/RemoveRequestOperationHandler.java
+++ 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/RemoveRequestOperationHandler.java
@@ -29,7 +29,7 @@ import 
org.apache.geode.internal.protocol.protobuf.v1.ProtobufSerializationServi
 import org.apache.geode.internal.protocol.protobuf.v1.RegionAPI;
 import org.apache.geode.internal.protocol.protobuf.v1.Result;
 import org.apache.geode.internal.protocol.protobuf.v1.Success;
-import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.utilities.ProtobufResponseUtilities;
 
 @Experimental
@@ -40,7 +40,8 @@ public class RemoveRequestOperationHandler
   @Override
   public Result<RegionAPI.RemoveResponse, ClientProtocol.ErrorResponse> 
process(
       ProtobufSerializationService serializationService, 
RegionAPI.RemoveRequest request,
-      MessageExecutionContext messageExecutionContext) throws 
InvalidExecutionContextException {
+      MessageExecutionContext messageExecutionContext)
+      throws InvalidExecutionContextException, DecodingException {
 
     String regionName = request.getRegionName();
     Region region = messageExecutionContext.getCache().getRegion(regionName);
@@ -56,11 +57,6 @@ public class RemoveRequestOperationHandler
       region.remove(decodedKey);
 
       return Success.of(RegionAPI.RemoveResponse.newBuilder().build());
-    } catch (EncodingException ex) {
-      // can be thrown by encoding or decoding.
-      logger.error("Received Remove request with unsupported encoding: {}", 
ex);
-      return Failure.of(ProtobufResponseUtilities.makeErrorResponse(
-          BasicTypes.ErrorCode.INVALID_REQUEST, "Encoding not supported: " + 
ex.getMessage()));
     } finally {
       messageExecutionContext.getStatistics().endOperation(startTime);
     }
diff --git 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/security/AuthenticationRequestOperationHandler.java
 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/security/AuthenticationRequestOperationHandler.java
index bef0ce3..15f057e 100644
--- 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/security/AuthenticationRequestOperationHandler.java
+++ 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/security/AuthenticationRequestOperationHandler.java
@@ -16,9 +16,7 @@ package 
org.apache.geode.internal.protocol.protobuf.v1.operations.security;
 
 import java.util.Properties;
 
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-
+import org.apache.geode.internal.exception.InvalidExecutionContextException;
 import org.apache.geode.internal.protocol.operations.ProtobufOperationHandler;
 import org.apache.geode.internal.protocol.protobuf.v1.ClientProtocol;
 import org.apache.geode.internal.protocol.protobuf.v1.ConnectionAPI;
@@ -26,6 +24,8 @@ import 
org.apache.geode.internal.protocol.protobuf.v1.MessageExecutionContext;
 import 
org.apache.geode.internal.protocol.protobuf.v1.ProtobufSerializationService;
 import org.apache.geode.internal.protocol.protobuf.v1.Result;
 import org.apache.geode.internal.protocol.protobuf.v1.Success;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.state.ProtobufConnectionAuthenticatingStateProcessor;
 import 
org.apache.geode.internal.protocol.protobuf.v1.state.ProtobufConnectionStateProcessor;
 import 
org.apache.geode.internal.protocol.protobuf.v1.state.ProtobufConnectionTerminatingStateProcessor;
diff --git 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/serialization/JsonPdxConverter.java
 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/serialization/JsonPdxConverter.java
index 4454648..7950882 100644
--- 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/serialization/JsonPdxConverter.java
+++ 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/serialization/JsonPdxConverter.java
@@ -15,6 +15,7 @@
 package org.apache.geode.internal.protocol.protobuf.v1.serialization;
 
 import org.apache.geode.annotations.Experimental;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
 import org.apache.geode.pdx.JSONFormatter;
 import org.apache.geode.pdx.JSONFormatterException;
@@ -23,11 +24,11 @@ import org.apache.geode.pdx.PdxInstance;
 @Experimental
 public class JsonPdxConverter implements TypeConverter<String, PdxInstance> {
   @Override
-  public PdxInstance decode(String incoming) throws EncodingException {
+  public PdxInstance decode(String incoming) throws DecodingException {
     try {
       return JSONFormatter.fromJSON(incoming);
     } catch (JSONFormatterException ex) {
-      throw new EncodingException("Could not decode JSON-encoded object ", ex);
+      throw new DecodingException("Could not decode JSON-encoded object ", ex);
     }
   }
 
diff --git 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/serialization/SerializationService.java
 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/serialization/SerializationService.java
index fa57042..bb83e11 100644
--- 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/serialization/SerializationService.java
+++ 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/serialization/SerializationService.java
@@ -15,6 +15,7 @@
 package org.apache.geode.internal.protocol.protobuf.v1.serialization;
 
 import org.apache.geode.annotations.Experimental;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
 
 /**
@@ -25,7 +26,7 @@ import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.En
  */
 @Experimental
 public interface SerializationService<T> {
-  Object decode(T encodedValue) throws EncodingException;
+  Object decode(T encodedValue) throws DecodingException;
 
   T encode(Object value) throws EncodingException;
 }
diff --git 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/serialization/TypeConverter.java
 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/serialization/TypeConverter.java
index e643af3..c62361b 100644
--- 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/serialization/TypeConverter.java
+++ 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/serialization/TypeConverter.java
@@ -15,6 +15,7 @@
 package org.apache.geode.internal.protocol.protobuf.v1.serialization;
 
 import org.apache.geode.annotations.Experimental;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
 
 /**
@@ -26,7 +27,7 @@ import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.En
  */
 @Experimental
 public interface TypeConverter<F, T> {
-  T decode(F incoming) throws EncodingException;
+  T decode(F incoming) throws DecodingException;
 
   F encode(T incoming) throws EncodingException;
 
diff --git 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/serialization/exception/EncodingException.java
 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/serialization/exception/DecodingException.java
similarity index 87%
copy from 
geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/serialization/exception/EncodingException.java
copy to 
geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/serialization/exception/DecodingException.java
index 2dd597d..93cedff 100644
--- 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/serialization/exception/EncodingException.java
+++ 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/serialization/exception/DecodingException.java
@@ -20,12 +20,12 @@ import org.apache.geode.annotations.Experimental;
  * This indicates an encoding type that we don't know how to handle.
  */
 @Experimental
-public class EncodingException extends Exception {
-  public EncodingException(String message) {
+public class DecodingException extends Exception {
+  public DecodingException(String message) {
     super(message);
   }
 
-  public EncodingException(String message, Throwable cause) {
+  public DecodingException(String message, Throwable cause) {
     super(message, cause);
   }
 }
diff --git 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/serialization/exception/EncodingException.java
 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/serialization/exception/EncodingException.java
index 2dd597d..1c2c615 100644
--- 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/serialization/exception/EncodingException.java
+++ 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/serialization/exception/EncodingException.java
@@ -17,7 +17,7 @@ package 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception;
 import org.apache.geode.annotations.Experimental;
 
 /**
- * This indicates an encoding type that we don't know how to handle.
+ * This indicates a Java object that we don't know how to handle.
  */
 @Experimental
 public class EncodingException extends Exception {
diff --git 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/utilities/ProtobufResponseUtilities.java
 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/utilities/ProtobufResponseUtilities.java
index c8814af..8bdcd2e 100644
--- 
a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/utilities/ProtobufResponseUtilities.java
+++ 
b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/utilities/ProtobufResponseUtilities.java
@@ -21,6 +21,8 @@ import org.apache.geode.cache.Region;
 import org.apache.geode.internal.protocol.protobuf.v1.BasicTypes;
 import org.apache.geode.internal.protocol.protobuf.v1.ClientProtocol;
 import org.apache.geode.internal.protocol.protobuf.v1.RegionAPI;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.state.exception.ConnectionStateException;
 
 
@@ -59,4 +61,15 @@ public abstract class ProtobufResponseUtilities {
   public static ClientProtocol.ErrorResponse 
makeErrorResponse(ConnectionStateException exception) {
     return makeErrorResponse(exception.getErrorCode(), exception.getMessage());
   }
+
+  public static ClientProtocol.ErrorResponse makeErrorResponse(Exception 
exception) {
+    if (exception instanceof ConnectionStateException) {
+      return makeErrorResponse((ConnectionStateException) exception);
+    }
+    return ClientProtocol.ErrorResponse
+        .newBuilder().setError(BasicTypes.Error.newBuilder()
+            
.setErrorCode(BasicTypes.ErrorCode.SERVER_ERROR).setMessage(exception.toString()))
+        .build();
+  }
+
 }
diff --git 
a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/ExecuteFunctionOnMemberIntegrationTest.java
 
b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/ExecuteFunctionOnMemberIntegrationTest.java
index b44a23f..3f70c60 100644
--- 
a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/ExecuteFunctionOnMemberIntegrationTest.java
+++ 
b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/ExecuteFunctionOnMemberIntegrationTest.java
@@ -26,12 +26,9 @@ import static org.mockito.Mockito.when;
 
 import java.io.IOException;
 import java.net.Socket;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.HashSet;
 import java.util.Properties;
-import java.util.Set;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicReference;
 
@@ -46,13 +43,11 @@ import org.junit.experimental.categories.Category;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.DataPolicy;
-import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionFactory;
 import org.apache.geode.cache.execute.Function;
 import org.apache.geode.cache.execute.FunctionContext;
 import org.apache.geode.cache.execute.FunctionException;
 import org.apache.geode.cache.execute.FunctionService;
-import org.apache.geode.cache.execute.RegionFunctionContext;
 import org.apache.geode.cache.server.CacheServer;
 import org.apache.geode.distributed.ConfigurationProperties;
 import org.apache.geode.internal.AvailablePortHelper;
diff --git 
a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/acceptance/CacheOperationsJUnitTest.java
 
b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/acceptance/CacheOperationsJUnitTest.java
index fd007c6..1d44676 100644
--- 
a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/acceptance/CacheOperationsJUnitTest.java
+++ 
b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/acceptance/CacheOperationsJUnitTest.java
@@ -319,8 +319,18 @@ public class CacheOperationsJUnitTest {
     RegionAPI.GetAllResponse getAllResponse = response.getGetAllResponse();
     assertEquals(3, getAllResponse.getEntriesCount());
     for (BasicTypes.Entry result : getAllResponse.getEntriesList()) {
-      String key = (String) serializationService.decode(result.getKey());
-      String value = (String) serializationService.decode(result.getValue());
+      String key = null;
+      try {
+        key = (String) serializationService.decode(result.getKey());
+      } catch 
(org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException
 e) {
+        e.printStackTrace();
+      }
+      String value = null;
+      try {
+        value = (String) serializationService.decode(result.getValue());
+      } catch 
(org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException
 e) {
+        e.printStackTrace();
+      }
       switch (key) {
         case TEST_MULTIOP_KEY1:
           assertEquals(TEST_MULTIOP_VALUE1, value);
diff --git 
a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetAllRequestOperationHandlerJUnitTest.java
 
b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetAllRequestOperationHandlerJUnitTest.java
index 6a4d03e..41ea242 100644
--- 
a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetAllRequestOperationHandlerJUnitTest.java
+++ 
b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetAllRequestOperationHandlerJUnitTest.java
@@ -17,15 +17,19 @@ package 
org.apache.geode.internal.protocol.protobuf.v1.operations;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.isA;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -35,9 +39,11 @@ import org.apache.geode.cache.CacheLoaderException;
 import org.apache.geode.cache.Region;
 import org.apache.geode.internal.protocol.TestExecutionContext;
 import org.apache.geode.internal.protocol.protobuf.v1.BasicTypes;
+import 
org.apache.geode.internal.protocol.protobuf.v1.ProtobufSerializationService;
 import org.apache.geode.internal.protocol.protobuf.v1.RegionAPI;
 import org.apache.geode.internal.protocol.protobuf.v1.Result;
 import org.apache.geode.internal.protocol.protobuf.v1.Success;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.utilities.ProtobufRequestUtilities;
 import org.apache.geode.test.junit.categories.UnitTest;
@@ -70,6 +76,44 @@ public class GetAllRequestOperationHandlerJUnitTest extends 
OperationHandlerJUni
   }
 
   @Test
+  public void processReturnsErrorUnableToDecodeRequest() throws Exception {
+    Exception exception = new DecodingException("error finding codec for 
type");
+    ProtobufSerializationService serializationServiceStub =
+        mock(ProtobufSerializationService.class);
+    
when(serializationServiceStub.decode(any())).thenReturn(TEST_KEY1).thenThrow(exception);
+    when(serializationServiceStub.encode(any()))
+        .thenReturn(BasicTypes.EncodedValue.newBuilder().setStringResult("some 
value").build());
+
+    BasicTypes.EncodedValue encodedKey1 =
+        
BasicTypes.EncodedValue.newBuilder().setStringResult(TEST_KEY1).build();
+
+    BasicTypes.EncodedValue encodedKey2 =
+        
BasicTypes.EncodedValue.newBuilder().setStringResult(TEST_KEY2).build();
+
+    Set<BasicTypes.EncodedValue> keys = new HashSet<>();
+    keys.add(encodedKey1);
+    keys.add(encodedKey2);
+    RegionAPI.GetAllRequest getRequest =
+        ProtobufRequestUtilities.createGetAllRequest(TEST_REGION, keys);
+
+    Result response = operationHandler.process(serializationServiceStub, 
getRequest,
+        TestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
+
+    assertTrue("response was " + response, response instanceof Success);
+
+    RegionAPI.GetAllResponse message = (RegionAPI.GetAllResponse) 
response.getMessage();
+    assertEquals(1, message.getFailuresCount());
+
+    BasicTypes.KeyedError error = message.getFailures(0);
+    assertEquals(BasicTypes.ErrorCode.INVALID_REQUEST, 
error.getError().getErrorCode());
+    assertTrue(error.getError().getMessage().contains("encoding not 
supported"));
+
+    assertEquals(1, message.getEntriesCount());
+  }
+
+
+
+  @Test
   public void processReturnsExpectedValuesForValidKeys() throws Exception {
     Result result = operationHandler.process(serializationService, 
generateTestRequest(true, false),
         TestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
diff --git 
a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetRequestOperationHandlerJUnitTest.java
 
b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetRequestOperationHandlerJUnitTest.java
index bd0a416..47a651c 100644
--- 
a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetRequestOperationHandlerJUnitTest.java
+++ 
b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/operations/GetRequestOperationHandlerJUnitTest.java
@@ -28,10 +28,13 @@ import 
org.apache.geode.internal.protocol.TestExecutionContext;
 import org.apache.geode.internal.protocol.protobuf.v1.BasicTypes;
 import org.apache.geode.internal.protocol.protobuf.v1.ClientProtocol;
 import org.apache.geode.internal.protocol.protobuf.v1.Failure;
+import org.apache.geode.internal.protocol.protobuf.v1.ProtobufOpsProcessor;
 import 
org.apache.geode.internal.protocol.protobuf.v1.ProtobufSerializationService;
 import org.apache.geode.internal.protocol.protobuf.v1.RegionAPI;
 import org.apache.geode.internal.protocol.protobuf.v1.Result;
 import org.apache.geode.internal.protocol.protobuf.v1.Success;
+import 
org.apache.geode.internal.protocol.protobuf.v1.registry.ProtobufOperationContextRegistry;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.utilities.ProtobufRequestUtilities;
 import org.apache.geode.test.junit.categories.UnitTest;
@@ -103,9 +106,9 @@ public class GetRequestOperationHandlerJUnitTest extends 
OperationHandlerJUnitTe
     Assert.assertTrue(response instanceof Success);
   }
 
-  @Test
-  public void processReturnsErrorWhenUnableToDecodeRequest() throws Exception {
-    EncodingException exception = new EncodingException("error finding codec 
for type");
+  @Test(expected = DecodingException.class)
+  public void processThrowsExceptionWhenUnableToDecodeRequest() throws 
Exception {
+    Exception exception = new DecodingException("error finding codec for 
type");
     ProtobufSerializationService serializationServiceStub =
         mock(ProtobufSerializationService.class);
     when(serializationServiceStub.decode(any())).thenThrow(exception);
@@ -115,14 +118,8 @@ public class GetRequestOperationHandlerJUnitTest extends 
OperationHandlerJUnitTe
     RegionAPI.GetRequest getRequest =
         ProtobufRequestUtilities.createGetRequest(TEST_REGION, 
encodedKey).getGetRequest();
 
-    Result response = operationHandler.process(serializationServiceStub, 
getRequest,
+    operationHandler.process(serializationServiceStub, getRequest,
         TestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
-
-    Assert.assertTrue(response instanceof Failure);
-    ClientProtocol.ErrorResponse errorMessage =
-        (ClientProtocol.ErrorResponse) response.getErrorMessage();
-    Assert.assertEquals(BasicTypes.ErrorCode.INVALID_REQUEST,
-        errorMessage.getError().getErrorCode());
   }
 
   private RegionAPI.GetRequest generateTestRequest(boolean missingRegion, 
boolean missingKey,
diff --git 
a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/operations/PutAllRequestOperationHandlerJUnitTest.java
 
b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/operations/PutAllRequestOperationHandlerJUnitTest.java
index de00034..5363893 100644
--- 
a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/operations/PutAllRequestOperationHandlerJUnitTest.java
+++ 
b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/operations/PutAllRequestOperationHandlerJUnitTest.java
@@ -31,10 +31,13 @@ import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import org.apache.geode.cache.Region;
+import org.apache.geode.internal.protocol.TestExecutionContext;
 import org.apache.geode.internal.protocol.protobuf.v1.BasicTypes;
+import 
org.apache.geode.internal.protocol.protobuf.v1.ProtobufSerializationService;
 import org.apache.geode.internal.protocol.protobuf.v1.RegionAPI;
 import org.apache.geode.internal.protocol.protobuf.v1.Result;
 import org.apache.geode.internal.protocol.protobuf.v1.Success;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.utilities.ProtobufRequestUtilities;
 import 
org.apache.geode.internal.protocol.protobuf.v1.utilities.ProtobufUtilities;
@@ -62,12 +65,49 @@ public class PutAllRequestOperationHandlerJUnitTest extends 
OperationHandlerJUni
         .thenThrow(new ClassCastException(EXCEPTION_TEXT));
 
     when(cacheStub.getRegion(TEST_REGION)).thenReturn(regionMock);
+
+    operationHandler = new PutAllRequestOperationHandler();
   }
 
   @Test
-  public void processInsertsMultipleValidEntriesInCache() throws Exception {
-    PutAllRequestOperationHandler operationHandler = new 
PutAllRequestOperationHandler();
+  public void processReturnsErrorUnableToDecodeRequest() throws Exception {
+    Exception exception = new DecodingException("error finding codec for 
type");
+    ProtobufSerializationService serializationServiceStub =
+        mock(ProtobufSerializationService.class);
+    when(serializationServiceStub.decode(any())).thenReturn(TEST_KEY1, 
TEST_VALUE1)
+        .thenThrow(exception);
+    when(serializationServiceStub.encode(any()))
+        .thenReturn(BasicTypes.EncodedValue.newBuilder().setStringResult("some 
string").build());
+
+    BasicTypes.EncodedValue encodedObject1 =
+        
BasicTypes.EncodedValue.newBuilder().setStringResult(TEST_KEY1).build();
+    BasicTypes.EncodedValue encodedObject2 =
+        
BasicTypes.EncodedValue.newBuilder().setStringResult(TEST_KEY2).build();
+
+    Set<BasicTypes.Entry> entries = new HashSet<>();
+    entries.add(ProtobufUtilities.createEntry(encodedObject1, encodedObject1));
+    entries.add(ProtobufUtilities.createEntry(encodedObject2, encodedObject2));
+
+    RegionAPI.PutAllRequest putAllRequest =
+        ProtobufRequestUtilities.createPutAllRequest(TEST_REGION, 
entries).getPutAllRequest();
+
+    Result response = operationHandler.process(serializationServiceStub, 
putAllRequest,
+        TestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
+
+    assertTrue("response was " + response, response instanceof Success);
+
+    RegionAPI.PutAllResponse message = (RegionAPI.PutAllResponse) 
response.getMessage();
+    assertEquals(1, message.getFailedKeysCount());
 
+    BasicTypes.KeyedError error = message.getFailedKeys(0);
+    assertEquals(BasicTypes.ErrorCode.INVALID_REQUEST, 
error.getError().getErrorCode());
+    assertTrue(error.getError().getMessage().contains("Encoding not 
supported"));
+  }
+
+
+
+  @Test
+  public void processInsertsMultipleValidEntriesInCache() throws Exception {
     Result result = operationHandler.process(serializationService, 
generateTestRequest(false, true),
         getNoAuthCacheExecutionContext(cacheStub));
 
@@ -80,8 +120,6 @@ public class PutAllRequestOperationHandlerJUnitTest extends 
OperationHandlerJUni
 
   @Test
   public void processWithInvalidEntrySucceedsAndReturnsFailedKey() throws 
Exception {
-    PutAllRequestOperationHandler operationHandler = new 
PutAllRequestOperationHandler();
-
     Result result = operationHandler.process(serializationService, 
generateTestRequest(true, true),
         getNoAuthCacheExecutionContext(cacheStub));
 
@@ -98,8 +136,6 @@ public class PutAllRequestOperationHandlerJUnitTest extends 
OperationHandlerJUni
 
   @Test
   public void processWithNoEntriesPasses() throws Exception {
-    PutAllRequestOperationHandler operationHandler = new 
PutAllRequestOperationHandler();
-
     Result result = operationHandler.process(serializationService,
         generateTestRequest(false, false), 
getNoAuthCacheExecutionContext(cacheStub));
 
diff --git 
a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/operations/PutRequestOperationHandlerJUnitTest.java
 
b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/operations/PutRequestOperationHandlerJUnitTest.java
index 4322bec..2da76b6 100644
--- 
a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/operations/PutRequestOperationHandlerJUnitTest.java
+++ 
b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/operations/PutRequestOperationHandlerJUnitTest.java
@@ -36,6 +36,7 @@ import 
org.apache.geode.internal.protocol.protobuf.v1.ProtobufSerializationServi
 import org.apache.geode.internal.protocol.protobuf.v1.RegionAPI;
 import org.apache.geode.internal.protocol.protobuf.v1.Result;
 import org.apache.geode.internal.protocol.protobuf.v1.Success;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.utilities.ProtobufRequestUtilities;
 import 
org.apache.geode.internal.protocol.protobuf.v1.utilities.ProtobufUtilities;
@@ -68,10 +69,10 @@ public class PutRequestOperationHandlerJUnitTest extends 
OperationHandlerJUnitTe
     verify(regionMock, times(1)).put(anyString(), anyString());
   }
 
-  @Test
-  public void test_invalidEncodingType() throws Exception {
+  @Test(expected = DecodingException.class)
+  public void processThrowsExceptionWhenUnableToDecode() throws Exception {
     String exceptionText = "unsupported type!";
-    EncodingException exception = new EncodingException(exceptionText);
+    Exception exception = new DecodingException(exceptionText);
     ProtobufSerializationService serializationServiceStub =
         mock(ProtobufSerializationService.class);
     when(serializationServiceStub.decode(any())).thenThrow(exception);
@@ -85,13 +86,8 @@ public class PutRequestOperationHandlerJUnitTest extends 
OperationHandlerJUnitTe
     BasicTypes.Entry testEntry = ProtobufUtilities.createEntry(encodedKey, 
testValue);
     RegionAPI.PutRequest putRequest =
         ProtobufRequestUtilities.createPutRequest(TEST_REGION, 
testEntry).getPutRequest();
-    Result result = operationHandler.process(serializationServiceStub, 
putRequest,
+    operationHandler.process(serializationServiceStub, putRequest,
         TestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
-
-    assertTrue(result instanceof Failure);
-    ClientProtocol.ErrorResponse errorMessage =
-        (ClientProtocol.ErrorResponse) result.getErrorMessage();
-    assertEquals(BasicTypes.ErrorCode.INVALID_REQUEST, 
errorMessage.getError().getErrorCode());
   }
 
   @Test
diff --git 
a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/operations/RemoveRequestOperationHandlerJUnitTest.java
 
b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/operations/RemoveRequestOperationHandlerJUnitTest.java
index 3e0d4b9..e42076c 100644
--- 
a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/operations/RemoveRequestOperationHandlerJUnitTest.java
+++ 
b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/operations/RemoveRequestOperationHandlerJUnitTest.java
@@ -34,6 +34,7 @@ import 
org.apache.geode.internal.protocol.protobuf.v1.ProtobufSerializationServi
 import org.apache.geode.internal.protocol.protobuf.v1.RegionAPI;
 import org.apache.geode.internal.protocol.protobuf.v1.Result;
 import org.apache.geode.internal.protocol.protobuf.v1.Success;
+import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.EncodingException;
 import 
org.apache.geode.internal.protocol.protobuf.v1.utilities.ProtobufRequestUtilities;
 import org.apache.geode.test.junit.categories.UnitTest;
@@ -90,9 +91,9 @@ public class RemoveRequestOperationHandlerJUnitTest extends 
OperationHandlerJUni
     assertTrue(result instanceof Success);
   }
 
-  @Test
-  public void processReturnsErrorWhenUnableToDecodeRequest() throws Exception {
-    EncodingException exception = new EncodingException("error finding codec 
for type");
+  @Test(expected = DecodingException.class)
+  public void processThrowsExceptionWhenUnableToDecodeRequest() throws 
Exception {
+    Exception exception = new DecodingException("error finding codec for 
type");
     ProtobufSerializationService serializationServiceStub =
         mock(ProtobufSerializationService.class);
     when(serializationServiceStub.decode(any())).thenThrow(exception);
@@ -102,13 +103,8 @@ public class RemoveRequestOperationHandlerJUnitTest 
extends OperationHandlerJUni
 
     RegionAPI.RemoveRequest removeRequest =
         ProtobufRequestUtilities.createRemoveRequest(TEST_REGION, 
encodedKey).getRemoveRequest();;
-    Result result = operationHandler.process(serializationServiceStub, 
removeRequest,
+    operationHandler.process(serializationServiceStub, removeRequest,
         TestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
-
-    assertTrue(result instanceof Failure);
-    ClientProtocol.ErrorResponse errorMessage =
-        (ClientProtocol.ErrorResponse) result.getErrorMessage();
-    assertEquals(BasicTypes.ErrorCode.INVALID_REQUEST, 
errorMessage.getError().getErrorCode());
   }
 
   private ClientProtocol.Message generateTestRequest(boolean missingRegion, 
boolean missingKey)
diff --git 
a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/utilities/ProtobufUtilitiesJUnitTest.java
 
b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/utilities/ProtobufUtilitiesJUnitTest.java
index 348711f..52ef576 100644
--- 
a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/utilities/ProtobufUtilitiesJUnitTest.java
+++ 
b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/v1/utilities/ProtobufUtilitiesJUnitTest.java
@@ -147,10 +147,18 @@ public class ProtobufUtilitiesJUnitTest {
   private <T> void createAndVerifyEncodedValue(T testObj) throws 
EncodingException {
     BasicTypes.EncodedValue encodedValue = 
protobufSerializationService.encode(testObj);
     if (testObj instanceof byte[]) {
-      assertArrayEquals((byte[]) testObj,
-          (byte[]) protobufSerializationService.decode(encodedValue));
+      try {
+        assertArrayEquals((byte[]) testObj,
+            (byte[]) protobufSerializationService.decode(encodedValue));
+      } catch 
(org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException
 e) {
+        e.printStackTrace();
+      }
     } else {
-      assertEquals(testObj, protobufSerializationService.decode(encodedValue));
+      try {
+        assertEquals(testObj, 
protobufSerializationService.decode(encodedValue));
+      } catch 
(org.apache.geode.internal.protocol.protobuf.v1.serialization.exception.DecodingException
 e) {
+        e.printStackTrace();
+      }
     }
   }
 }

-- 
To stop receiving notification emails like this one, please contact
bschucha...@apache.org.

Reply via email to