Skip to content

Commit

Permalink
GEODE-8459: Redis API for Geode handles errors when member disconnects (
Browse files Browse the repository at this point in the history
  • Loading branch information
sabbey37 authored Aug 26, 2020
1 parent 6ca548f commit cecf003
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@
import io.netty.handler.codec.DecoderException;
import org.apache.logging.log4j.Logger;

import org.apache.geode.ForcedDisconnectException;
import org.apache.geode.cache.CacheClosedException;
import org.apache.geode.cache.execute.FunctionException;
import org.apache.geode.cache.execute.FunctionInvocationTargetException;
import org.apache.geode.distributed.DistributedSystemDisconnectedException;
import org.apache.geode.logging.internal.log4j.api.LogService;
import org.apache.geode.redis.internal.GeodeRedisServer;
import org.apache.geode.redis.internal.ParameterRequirements.RedisParametersMismatchException;
Expand Down Expand Up @@ -167,8 +169,10 @@ private RedisResponse getExceptionResponse(ChannelHandlerContext ctx, Throwable
} else if (cause instanceof IllegalStateException
|| cause instanceof RedisParametersMismatchException) {
response = RedisResponse.error(cause.getMessage());
} else if (cause instanceof FunctionInvocationTargetException) {
// This indicates a member departed
} else if (cause instanceof FunctionInvocationTargetException
|| cause instanceof DistributedSystemDisconnectedException
|| cause instanceof ForcedDisconnectException) {
// This indicates a member departed or got disconnected
logger.warn(
"Closing client connection because one of the servers doing this operation departed.");
channelInactive(ctx);
Expand Down

0 comments on commit cecf003

Please sign in to comment.