Skip to content

Commit 70006df

Browse files
authored
When the thread is interrupted while retrying a connection, the loop will exit early. (#14062)
1 parent d723880 commit 70006df

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

iotdb-client/session/src/main/java/org/apache/iotdb/session/SessionConnection.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,13 @@ protected void withRetry(TFunction<TSStatus> function)
11091109
try {
11101110
TimeUnit.MILLISECONDS.sleep(retryIntervalInMs);
11111111
} catch (InterruptedException e) {
1112-
// just ignore
1112+
Thread.currentThread().interrupt();
1113+
logger.warn(
1114+
"Thread {} was interrupted during retry {} with wait time {} ms. Exiting retry loop.",
1115+
Thread.currentThread().getName(),
1116+
i,
1117+
retryIntervalInMs);
1118+
break;
11131119
}
11141120
if (!reconnect()) {
11151121
// reconnect failed, just continue to make another retry.

0 commit comments

Comments
 (0)