Throwable showRootCause(Optional<StreamOp> op, Throwable cause) { if (cause instanceof Failure) { Failure failure = (Failure) cause; if (failure.isFlagged(Failure.Wrapped())) { try { // if it is a wrapped failure, unwrap it first cause = failure.show(); } catch (IllegalArgumentException iae) { if (op.isPresent()) { logger.warn("Failed to unwrap finagle failure of stream {} : ", op.get().stream, iae); } else { logger.warn("Failed to unwrap finagle failure : ", iae); } } } } return cause; }
void handleFinagleFailure(Failure failure, Optional<StreamOp> op, SocketAddress addr) { if (failure.isFlagged(Failure.Restartable())) { if (op.isPresent()) { // redirect the request to other host doSend(op.get(), addr); } } else { // fail the request if it is other types of failures handleException(failure, op, addr); } }
Throwable showRootCause(Optional<StreamOp> op, Throwable cause) { if (cause instanceof Failure) { Failure failure = (Failure) cause; if (failure.isFlagged(Failure.Wrapped())) { try { // if it is a wrapped failure, unwrap it first cause = failure.show(); } catch (IllegalArgumentException iae) { if (op.isPresent()) { logger.warn("Failed to unwrap finagle failure of stream {} : ", op.get().stream, iae); } else { logger.warn("Failed to unwrap finagle failure : ", iae); } } } } return cause; }
Throwable showRootCause(Optional<StreamOp> op, Throwable cause) { if (cause instanceof Failure) { Failure failure = (Failure) cause; if (failure.isFlagged(Failure.Wrapped())) { try { // if it is a wrapped failure, unwrap it first cause = failure.show(); } catch (IllegalArgumentException iae) { if (op.isPresent()) { logger.warn("Failed to unwrap finagle failure of stream {} : ", op.get().stream, iae); } else { logger.warn("Failed to unwrap finagle failure : ", iae); } } } } return cause; }
void handleFinagleFailure(Failure failure, Optional<StreamOp> op, SocketAddress addr) { if (failure.isFlagged(Failure.Restartable())) { if (op.isPresent()) { // redirect the request to other host doSend(op.get(), addr); } } else { // fail the request if it is other types of failures handleException(failure, op, addr); } }
void handleFinagleFailure(Failure failure, Optional<StreamOp> op, SocketAddress addr) { if (failure.isFlagged(Failure.Restartable())) { if (op.isPresent()) { // redirect the request to other host doSend(op.get(), addr); } } else { // fail the request if it is other types of failures handleException(failure, op, addr); } }