@@ -17,7 +17,7 @@ import wvlet.airframe.control.Retry.RetryContext
17
17
import wvlet .airframe .control .{CircuitBreakerOpenException , ResultClass }
18
18
import wvlet .log .LogSupport
19
19
20
- import java .io .EOFException
20
+ import java .io .{ IOException , EOFException }
21
21
import java .lang .reflect .InvocationTargetException
22
22
import java .net .*
23
23
import java .nio .channels .ClosedChannelException
@@ -181,14 +181,18 @@ object HttpClientException extends LogSupport {
181
181
case e : SocketTimeoutException => retryableFailure(e)
182
182
case e : SocketException =>
183
183
e match {
184
- case se : BindException => retryableFailure(e)
185
- case se : ConnectException => retryableFailure(e)
186
- case se : NoRouteToHostException => retryableFailure(e)
187
- case se : PortUnreachableException => retryableFailure(e)
188
- case se if se.getMessage == " Socket closed" => retryableFailure(e)
184
+ case se : BindException => retryableFailure(e)
185
+ case se : ConnectException => retryableFailure(e)
186
+ case se : NoRouteToHostException => retryableFailure(e)
187
+ case se : PortUnreachableException => retryableFailure(e)
188
+ case se if se.getMessage() == " Socket closed" => retryableFailure(e)
189
189
case other =>
190
190
nonRetryableFailure(e)
191
191
}
192
+ // HTTP/2 may disconnects the connection with "GOAWAY received" error https://github.com/wvlet/airframe/issues/3421
193
+ // See also the code of jdk.internal.net.http.Http2Connection.handleGoAway
194
+ case e : IOException if Option (e.getMessage()).exists(_.contains(" GOAWAY received" )) =>
195
+ retryableFailure(e)
192
196
// Exceptions from Finagle. Using the string class names so as not to include Finagle dependencies.
193
197
case e : Throwable if isRetryableFinagleException(e) =>
194
198
retryableFailure(e)
0 commit comments