Skip to content

Wiring new methods to old methods#3743

Closed
a-TODO-rov wants to merge 3 commits into
feature/reactor-optional-1from
wire-connection-plumbing-v2
Closed

Wiring new methods to old methods#3743
a-TODO-rov wants to merge 3 commits into
feature/reactor-optional-1from
wire-connection-plumbing-v2

Conversation

@a-TODO-rov
Copy link
Copy Markdown
Contributor

@a-TODO-rov a-TODO-rov commented May 12, 2026

Make sure that:

  • You have read the contribution guidelines.
  • You have created a feature request first to discuss your contribution intent. Please reference the feature request ticket number in the pull request.
  • You applied code formatting rules using the mvn formatter:format target. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.

Note

Medium Risk
Touches connection establishment and auto-reconnect address resolution paths (including cluster connect retry logic), so regressions could impact connectivity despite mostly being API wiring/deprecation changes.

Overview
Shifts socket address resolution/connection wiring to prefer Supplier<CompletionStage<SocketAddress>> throughout AbstractRedisClient, ConnectionBuilder, RedisClient, and RedisClusterClient, while marking the prior Mono-based hooks as @Deprecated and adding new *Stage/*Async accessors.

Updates reconnect watchdogs (ConnectionWatchdog, MaintenanceAwareConnectionWatchdog) to wrap async suppliers via Mono internally and exposes wrapSocketAddressSupplierAsync, and rewrites cluster connect retry loops to use CompletableFuture chaining instead of Reactor Mono retry. Unit tests are adjusted to the new Mono-based RebindAwareAddressSupplier API.

Reviewed by Cursor Bugbot for commit 2147c44. Bugbot is set up for automated code reviews on this repo. Configure here.

@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented May 12, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

Comment thread src/main/java/io/lettuce/core/cluster/RedisClusterClient.java Outdated
Comment thread src/main/java/io/lettuce/core/protocol/ConnectionWatchdog.java Outdated
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2147c44. Configure here.

return Mono.fromCompletionStage(future).doOnError(t -> logger.warn(t.getMessage()));
}

@SuppressWarnings("unchecked")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead private connect methods after refactoring to connectFuture

Low Severity

The two private connect methods returning Mono<T> (one taking StatefulRedisClusterConnectionImpl, the other taking StatefulRedisConnectionImpl) are now unused dead code. All call sites that previously used these methods have been replaced with calls to the new connectFuture methods. A grep confirms no remaining callers exist within this class.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2147c44. Configure here.

logger.debug("RebindAwareAddressSupplier using rebind address: {}", current);
logger.debug("RebindAwareAddressSupplier rebind address: {}", current.rebindAddress);
return CompletableFuture.completedFuture(current.rebindAddress);
logger.debug("RebindAwareAddressSupplier using rebind address: {}", state.get());
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logging uses state.get() instead of captured current variable

Low Severity

Inside wrappedSupplier, the debug log statements at the top of the Mono.defer lambda use state.get() instead of the already-captured current local variable. In a concurrent environment, state could be updated by another thread between the initial read into current and the subsequent state.get() calls, causing the log to show a different state than what the code is actually acting upon. This makes debugging concurrent rebind issues misleading.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2147c44. Configure here.

@a-TODO-rov a-TODO-rov changed the title Wiring Wiring new methods to old methods May 13, 2026
@a-TODO-rov a-TODO-rov closed this May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant