Skip to content

Commit 40fc55a

Browse files
committed
Disable reconnect of stopped stream
1 parent f4a525f commit 40fc55a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

topic/src/main/java/tech/ydb/topic/impl/GrpcStreamRetrier.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ protected static String generateRandomId(int length) {
5555
}
5656

5757
private void tryScheduleReconnect() {
58+
if (isStopped.get()) {
59+
getLogger().info("[{}] {} is already stopped, no need to reconnect", id, getStreamName());
60+
return;
61+
}
62+
5863
int currentReconnectCounter = reconnectCounter.get() + 1;
5964
if (MAX_RECONNECT_COUNT > 0 && currentReconnectCounter > MAX_RECONNECT_COUNT) {
6065
if (isStopped.compareAndSet(false, true)) {

0 commit comments

Comments
 (0)