Skip to content

Commit 53206a1

Browse files
author
Stephane Landelle
committed
Exit fast on "Connection reset by peer", close AsyncHttpClient#821
1 parent e6db2bd commit 53206a1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
*/
1313
package org.asynchttpclient.providers.netty.commons.future;
1414

15+
import java.io.IOException;
16+
1517
public class StackTraceInspector {
1618

1719
private static boolean exceptionInMethod(Throwable t, String className, String methodName) {
@@ -42,6 +44,9 @@ public static boolean recoverOnNetty4DisconnectException(Throwable t) {
4244

4345
public static boolean recoverOnReadOrWriteException(Throwable t) {
4446

47+
if (t instanceof IOException && "Connection reset by peer".equalsIgnoreCase(t.getMessage()))
48+
return true;
49+
4550
try {
4651
for (StackTraceElement element : t.getStackTrace()) {
4752
String className = element.getClassName();

0 commit comments

Comments
 (0)