Skip to content

Fixes the failed node detector copy behavior in RedisClientConfig.#7226

Open
rahulrane50 wants to merge 1 commit into
redisson:masterfrom
rahulrane50:rrane_failed_detector_1
Open

Fixes the failed node detector copy behavior in RedisClientConfig.#7226
rahulrane50 wants to merge 1 commit into
redisson:masterfrom
rahulrane50:rrane_failed_detector_1

Conversation

@rahulrane50

@rahulrane50 rahulrane50 commented Jun 26, 2026

Copy link
Copy Markdown

Summary

Fixes the failed node detector copy behavior in RedisClientConfig. [issue]

RedisClientConfig creates per-node client configs, but previously reused the same FailedNodeDetector instance across copied configs. Since the built-in detectors keep
runtime failure state, failures from one node could contribute to another node's failure window.

This PR adds FailedNodeDetector.copy() and makes the built-in detectors return new instances with the same configuration but independent runtime state.
RedisClientConfig now uses the copy when cloning config.

Test:

JAVA_HOME=/Library/Java/JavaVirtualMachines/amazon-corretto-21.jdk/Contents/Home mvn -pl redisson -Punit-test -Dmaven.compiler.testRelease=21
-Dmaven.compiler.testSource=21 -Dmaven.compiler.testTarget=21 -Dtest=org.redisson.client.FailedNodeDetectorCopyTest test

@rahulrane50 rahulrane50 marked this pull request as ready for review June 26, 2026 20:58
@yipeng09

Copy link
Copy Markdown

Direction looks right to me. One suggestion: this PR is really doing two independent things, and it'd be worth either calling them out explicitly or splitting into two PRs.

  1. Bug fix — copy(). Today the RedisClientConfig copy constructor reuses the same FailedNodeDetector instance across every per-node RedisClient. Since detectors carry runtime state, one node's failures count toward another node's window, so isNodeFailed() is evaluated against cross-node-polluted state. copy() giving each node independent state is a genuine correctness fix and stands on its own.

  2. Observability — setNodeAddress(InetSocketAddress). This is purely additive: no behavior change for the built-in detectors, it just lets a custom detector wrapper know which node it's observing so it can attribute/log the failed address.

These are separable — the copy() fix is valuable regardless, and the address tagging only becomes meaningful once detectors are per-node, so it reads more like a follow-up built on top of (1). Splitting (or at least separating the commits) would make the bug fix easier to review and backport independently of the instrumentation. Either way, the description should make the distinction explicit.

@rahulrane50 rahulrane50 force-pushed the rrane_failed_detector_1 branch from f9c2b9a to 5521b08 Compare June 29, 2026 21:55
@rahulrane50 rahulrane50 changed the title Patching failed node detector per redis node and adding node addr Fixes the failed node detector copy behavior in RedisClientConfig. Jun 29, 2026
@rahulrane50 rahulrane50 force-pushed the rrane_failed_detector_1 branch from 5521b08 to 58e0fe2 Compare June 30, 2026 00:02
@mrniko mrniko added this to the 4.7.0 milestone Jun 30, 2026
@mrniko mrniko added the bug label Jun 30, 2026
@mrniko

mrniko commented Jun 30, 2026

Copy link
Copy Markdown
Member

Java CI failed

@rahulrane50 rahulrane50 force-pushed the rrane_failed_detector_1 branch from 58e0fe2 to 6deff59 Compare June 30, 2026 17:06
@rahulrane50

Copy link
Copy Markdown
Author

thanks @mrniko fixed the checstyle failure for CI. can you help me approve another java CI workflow?

@rahulrane50

Copy link
Copy Markdown
Author

@mrniko it's weird. I retried exact same CI job locally and it ran successfully.

JAVA_HOME=$(/usr/libexec/java_home -v 25) PATH="$(/usr/libexec/java_home -v 25)/bin:$PATH" mvn -T 1C -B clean verify -DskipTests -Dmaven.test.skip=false --file pom.xml

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  45.291 s (Wall Clock)
[INFO] Finished at: 2026-07-01T18:19:27-07:00
[INFO] ------------------------------------------------------------------------

Seems like that version got published later in maven repository and also this whole failure doesn't look like related to above PR.

The dependabot PR (#7237) ran its Java CI at 17:57–17:58 UTC on 2026-07-01, hit the exact same quarkus-extension-maven-plugin with the exact same unpinned-version warning,
  resolved to the exact same 3.37.1, and it succeeded — because by then, ~7 hours after 3.37.1 was published, Maven Central's mirrors had fully caught up and
  quarkus-devtools-common:3.37.1 was resolvable everywhere.

I'm not able to rerun it but can you help take a look or re-run? thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants