Skip to content

Commit 73370d7

Browse files
authored
fix: improve handling of expected socket exceptions when using connection poller (#1276)
1 parent a6f248a commit 73370d7

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"id": "6795f037-bb98-434b-8b87-1bbe59b2edb2",
3+
"type": "bugfix",
4+
"description": "Improve handling of excepted socket exceptions when using connection polling",
5+
"issues": [
6+
"awslabs/aws-sdk-kotlin#1214"
7+
]
8+
}

runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp/ConnectionIdleMonitor.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import okhttp3.Connection
1111
import okhttp3.ConnectionListener
1212
import okhttp3.ExperimentalOkHttpApi
1313
import okhttp3.internal.closeQuietly
14-
import okio.EOFException
14+
import okio.IOException
1515
import okio.buffer
1616
import okio.source
1717
import java.net.SocketException
@@ -96,7 +96,7 @@ internal class ConnectionIdleMonitor(val pollInterval: Duration) : ConnectionLis
9696
source.readByte() // Blocking read; will take up to `pollInterval` time to complete
9797
} catch (_: SocketTimeoutException) {
9898
logger.trace { "Socket still alive for $conn" }
99-
} catch (_: EOFException) {
99+
} catch (_: IOException) {
100100
logger.trace { "Socket closed remotely for $conn" }
101101
socket.closeQuietly()
102102
resetTimeout = false

0 commit comments

Comments
 (0)