Fix reconnection attempt count in ReactorNettyTcpClient

Prior to this commit, the reconnection attempt count provided to the
reconnect strategy would not give the updated, incremented value but
instead the previous one.

This commit fixes this and ensures the value is incremented before it's
given to the strategy.

Fixes gh-37223
This commit is contained in:
Brian Clozel
2026-09-01 11:18:53 +02:00
parent f3764f6d62
commit 04b3bdc1b3
@@ -222,7 +222,7 @@ public class ReactorNettyTcpClient<P> implements TcpOperations<P> {
.map(retrySignal -> (int) retrySignal.totalRetriesInARow())
.flatMap(attempt -> reconnect(attempt, strategy))))
.repeatWhen(flux -> flux
.scan(1, (count, element) -> count++)
.scan(1, (count, element) -> count + 1)
.flatMap(attempt -> reconnect(attempt, strategy)))
.subscribe();
return connectFuture;