@Override public boolean tryFailure(Throwable cause) { if (redirectError.get() != null) { return false; } if (cause instanceof RedisRedirectException) { return redirectError.compareAndSet(null, (RedisRedirectException) cause); } return super.tryFailure(cause); }
@Override public boolean tryFailure(Throwable cause) { if (redirectError.get() != null) { return false; } if (cause instanceof RedisRedirectException) { return redirectError.compareAndSet(null, (RedisRedirectException) cause); } return super.tryFailure(cause); }
} catch (Exception e) { log.error("Unable to decode data. channel: " + ctx.channel() + ", reply: " + LogHelper.toString(in), e); cmd.tryFailure(e); sendNext(ctx); throw e;
} catch (Exception e) { log.error("Unable to decode data. channel: " + ctx.channel() + ", reply: " + LogHelper.toString(in), e); cmd.tryFailure(e); sendNext(ctx); throw e;
msg.tryFailure(e); throw e;
msg.tryFailure(e); throw e;
int slot = Integer.valueOf(errorParts[1]); String addr = errorParts[2]; data.tryFailure(new RedisMovedException(slot, addr)); } else if (error.startsWith("ASK")) { String[] errorParts = error.split(" "); int slot = Integer.valueOf(errorParts[1]); String addr = errorParts[2]; data.tryFailure(new RedisAskException(slot, addr)); } else if (error.startsWith("TRYAGAIN")) { data.tryFailure(new RedisTryAgainException(error + ". channel: " + channel + " data: " + data)); } else if (error.startsWith("LOADING")) { data.tryFailure(new RedisLoadingException(error + ". channel: " + channel + " data: " + data)); } else if (error.startsWith("OOM")) { data.tryFailure(new RedisOutOfMemoryException(error.split("OOM ")[1] + ". channel: " + channel + " data: " + data)); } else if (error.contains("-OOM ")) { data.tryFailure(new RedisOutOfMemoryException(error.split("-OOM ")[1] + ". channel: " + channel + " data: " + data)); } else { if (data != null) { data.tryFailure(new RedisException(error + ". channel: " + channel + " command: " + LogHelper.toString(data))); } else { log.error("Error message from Redis: {} channel: {}", error, channel);
int slot = Integer.valueOf(errorParts[1]); String addr = errorParts[2]; data.tryFailure(new RedisMovedException(slot, addr)); } else if (error.startsWith("ASK")) { String[] errorParts = error.split(" "); int slot = Integer.valueOf(errorParts[1]); String addr = errorParts[2]; data.tryFailure(new RedisAskException(slot, addr)); } else if (error.startsWith("TRYAGAIN")) { data.tryFailure(new RedisTryAgainException(error + ". channel: " + channel + " data: " + data)); } else if (error.startsWith("LOADING")) { data.tryFailure(new RedisLoadingException(error + ". channel: " + channel + " data: " + data)); } else if (error.startsWith("OOM")) { data.tryFailure(new RedisOutOfMemoryException(error.split("OOM ")[1] + ". channel: " + channel + " data: " + data)); } else if (error.contains("-OOM ")) { data.tryFailure(new RedisOutOfMemoryException(error.split("-OOM ")[1] + ". channel: " + channel + " data: " + data)); } else { if (data != null) { data.tryFailure(new RedisException(error + ". channel: " + channel + " command: " + LogHelper.toString(data))); } else { log.error("Error message from Redis: {} channel: {}", error, channel);
} catch (Exception e) { log.error("Unable to decode data. channel: " + ctx.channel() + ", reply: " + LogHelper.toString(in) + ", command: " + LogHelper.toString(data), e); cmd.tryFailure(e); sendNext(ctx); throw e;
decode(in, commandData, respParts, ctx, skipConvertor); if (commandData.getPromise().isDone() && !commandData.getPromise().isSuccess()) { data.tryFailure(commandData.cause());
} catch (Exception e) { log.error("Unable to decode data. channel: " + ctx.channel() + ", reply: " + LogHelper.toString(in) + ", command: " + LogHelper.toString(data), e); cmd.tryFailure(e); sendNext(ctx); throw e;
decode(in, commandData, respParts, ctx, skipConvertor); if (commandData.getPromise().isDone() && !commandData.getPromise().isSuccess()) { data.tryFailure(commandData.cause());
commandData.tryFailure(e);
commandData.tryFailure(e);
@Override public boolean tryFailure(Throwable cause) { if (redirectError.get() != null) { return false; } if (cause instanceof RedisRedirectException) { return redirectError.compareAndSet(null, (RedisRedirectException) cause); } return super.tryFailure(cause); }
int slot = Integer.valueOf(errorParts[1]); String addr = errorParts[2]; data.tryFailure(new RedisMovedException(slot, addr)); } else if (error.startsWith("ASK")) { String[] errorParts = error.split(" "); int slot = Integer.valueOf(errorParts[1]); String addr = errorParts[2]; data.tryFailure(new RedisAskException(slot, addr)); } else if (error.startsWith("TRYAGAIN")) { data.tryFailure(new RedisTryAgainException(error + ". channel: " + channel + " data: " + data)); } else if (error.startsWith("LOADING")) { data.tryFailure(new RedisLoadingException(error + ". channel: " + channel + " data: " + data)); } else if (error.startsWith("OOM")) { data.tryFailure(new RedisOutOfMemoryException(error.split("OOM ")[1] + ". channel: " + channel + " data: " + data)); } else if (error.contains("-OOM ")) { data.tryFailure(new RedisOutOfMemoryException(error.split("-OOM ")[1] + ". channel: " + channel + " data: " + data)); } else { if (data != null) { data.tryFailure(new RedisException(error + ". channel: " + channel + " command: " + LogHelper.toString(data))); } else { log.error("Error message from Redis: {} channel: {}", error, channel);
@Override protected void decodeCommand(Channel channel, ByteBuf in, QueueCommand data) throws Exception { if (data == null) { try { while (in.writerIndex() > in.readerIndex()) { decode(in, null, null, channel, false, null); } sendNext(channel); } catch (Exception e) { log.error("Unable to decode data. channel: " + channel + ", reply: " + LogHelper.toString(in), e); sendNext(channel); throw e; } } else if (data instanceof CommandData) { CommandData<Object, Object> cmd = (CommandData<Object, Object>)data; try { while (in.writerIndex() > in.readerIndex()) { decode(in, cmd, null, channel, false, null); } sendNext(channel, data); } catch (Exception e) { log.error("Unable to decode data. channel: " + channel + ", reply: " + LogHelper.toString(in), e); cmd.tryFailure(e); sendNext(channel); throw e; } } }
msg.tryFailure(e); throw e;
decode(in, commandData, respParts, channel, skipConvertor, commandsData); if (commandData.getPromise().isDone() && !commandData.getPromise().isSuccess()) { data.tryFailure(commandData.cause());
} catch (Exception e) { log.error("Unable to decode data. channel: " + channel + ", reply: " + LogHelper.toString(in) + ", command: " + LogHelper.toString(data), e); cmd.tryFailure(e); decoderStatus.set(Status.NORMAL); sendNext(channel);