Skip to content

Commit 641f574

Browse files
takezoewendigo
authored andcommitted
Close StatementClient when request is timed out
1 parent e039c6d commit 641f574

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

client/trino-client/src/main/java/io/trino/client/StatementClientV1.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ private boolean executeRequest(Request request, String taskName, OptionalLong ma
403403
if (attempts > 0) {
404404
Duration sinceStart = Duration.nanosSince(start);
405405
if (sinceStart.compareTo(requestTimeoutNanos) > 0) {
406+
close();
406407
state.compareAndSet(State.RUNNING, State.CLIENT_ERROR);
407408
throw new RuntimeException(format("Error fetching next (attempts: %s, duration: %s)", attempts, sinceStart), cause);
408409
}

0 commit comments

Comments
 (0)