Skip to content

Commit e6db2bd

Browse files
author
Stephane Landelle
committed
Rename StackTraceInspector methods
1 parent 8596041 commit e6db2bd

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

providers/netty-commons/src/main/java/org/asynchttpclient/providers/netty/commons/future/StackTraceInspector.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@ private static boolean exceptionInMethod(Throwable t, String className, String m
2525
return false;
2626
}
2727

28-
private static boolean abortOnConnectCloseException(Throwable t) {
28+
private static boolean recoverOnConnectCloseException(Throwable t) {
2929
return exceptionInMethod(t, "sun.nio.ch.SocketChannelImpl", "checkConnect")
30-
|| (t.getCause() != null && abortOnConnectCloseException(t.getCause()));
30+
|| (t.getCause() != null && recoverOnConnectCloseException(t.getCause()));
3131
}
3232

33-
public static boolean abortOnNetty3DisconnectException(Throwable t) {
33+
public static boolean recoverOnNetty3DisconnectException(Throwable t) {
3434
return exceptionInMethod(t, "io.netty.handler.ssl.SslHandler", "disconnect")
35-
|| (t.getCause() != null && abortOnConnectCloseException(t.getCause()));
35+
|| (t.getCause() != null && recoverOnConnectCloseException(t.getCause()));
3636
}
3737

38-
public static boolean abortOnNetty4DisconnectException(Throwable t) {
38+
public static boolean recoverOnNetty4DisconnectException(Throwable t) {
3939
return exceptionInMethod(t, "io.netty.handler.ssl.SslHandler", "disconnect")
40-
|| (t.getCause() != null && abortOnConnectCloseException(t.getCause()));
40+
|| (t.getCause() != null && recoverOnConnectCloseException(t.getCause()));
4141
}
4242

43-
public static boolean abortOnReadOrWriteException(Throwable t) {
43+
public static boolean recoverOnReadOrWriteException(Throwable t) {
4444

4545
try {
4646
for (StackTraceElement element : t.getStackTrace()) {
@@ -53,7 +53,7 @@ public static boolean abortOnReadOrWriteException(Throwable t) {
5353
}
5454

5555
if (t.getCause() != null)
56-
return abortOnReadOrWriteException(t.getCause());
56+
return recoverOnReadOrWriteException(t.getCause());
5757

5858
return false;
5959
}

providers/netty3/src/main/java/org/asynchttpclient/providers/netty3/handler/Processor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws
158158
}
159159

160160
// FIXME how does recovery occur?!
161-
if (StackTraceInspector.abortOnReadOrWriteException(cause)) {
161+
if (StackTraceInspector.recoverOnReadOrWriteException(cause)) {
162162
LOGGER.debug("Trying to recover from dead Channel: {}", channel);
163163
return;
164164
}

providers/netty3/src/main/java/org/asynchttpclient/providers/netty3/request/NettyConnectListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private void onFutureFailure(Channel channel, Throwable cause) {
9191
LOGGER.debug("Trying to recover from failing to connect channel {} with a retry value of {} ", channel, canRetry);
9292
if (canRetry
9393
&& cause != null
94-
&& (cause instanceof ClosedChannelException || future.getState() != NettyResponseFuture.STATE.NEW || StackTraceInspector.abortOnNetty3DisconnectException(cause))) {
94+
&& (cause instanceof ClosedChannelException || future.getState() != NettyResponseFuture.STATE.NEW || StackTraceInspector.recoverOnNetty3DisconnectException(cause))) {
9595

9696
if (!requestSender.retry(future))
9797
return;

providers/netty3/src/main/java/org/asynchttpclient/providers/netty3/request/ProgressListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ private boolean abortOnThrowable(Throwable cause, Channel channel) {
5151
if (cause != null && future.getState() != NettyResponseFuture.STATE.NEW) {
5252
// The write operation failed. If the channel was cached, it means it got asynchronously closed.
5353
// Let's retry a second time.
54-
if (cause instanceof IllegalStateException || cause instanceof ClosedChannelException || StackTraceInspector.abortOnReadOrWriteException(cause)) {
54+
if (cause instanceof IllegalStateException || cause instanceof ClosedChannelException || StackTraceInspector.recoverOnReadOrWriteException(cause)) {
5555
LOGGER.debug(cause == null ? "" : cause.getMessage(), cause);
5656
Channels.silentlyCloseChannel(channel);
5757

providers/netty4/src/main/java/org/asynchttpclient/providers/netty4/handler/Processor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable e) throws Excep
141141
}
142142
}
143143

144-
if (StackTraceInspector.abortOnReadOrWriteException(cause)) {
144+
if (StackTraceInspector.recoverOnReadOrWriteException(cause)) {
145145
LOGGER.debug("Trying to recover from dead Channel: {}", channel);
146146
return;
147147
}

providers/netty4/src/main/java/org/asynchttpclient/providers/netty4/request/NettyConnectListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private void onFutureFailure(Channel channel, Throwable cause) {
8989
LOGGER.debug("Trying to recover from failing to connect channel {} with a retry value of {} ", channel, canRetry);
9090
if (canRetry//
9191
&& cause != null//
92-
&& (cause instanceof ClosedChannelException || future.getState() != NettyResponseFuture.STATE.NEW || StackTraceInspector.abortOnNetty4DisconnectException(cause))) {
92+
&& (cause instanceof ClosedChannelException || future.getState() != NettyResponseFuture.STATE.NEW || StackTraceInspector.recoverOnNetty4DisconnectException(cause))) {
9393

9494
if (requestSender.retry(future)) {
9595
return;

providers/netty4/src/main/java/org/asynchttpclient/providers/netty4/request/ProgressListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public ProgressListener(AsyncHttpClientConfig config,//
5555
private boolean abortOnThrowable(Throwable cause, Channel channel) {
5656

5757
if (cause != null && future.getState() != NettyResponseFuture.STATE.NEW) {
58-
if (cause instanceof IllegalStateException || cause instanceof ClosedChannelException || StackTraceInspector.abortOnReadOrWriteException(cause)) {
58+
if (cause instanceof IllegalStateException || cause instanceof ClosedChannelException || StackTraceInspector.recoverOnReadOrWriteException(cause)) {
5959
LOGGER.debug(cause.getMessage(), cause);
6060
Channels.silentlyCloseChannel(channel);
6161

0 commit comments

Comments
 (0)