Skip to content

fix bug: issue #3595 and add unit test #3661

Open
kael-aiur wants to merge 3 commits intoredis:mainfrom
kael-aiur:main
Open

fix bug: issue #3595 and add unit test #3661
kael-aiur wants to merge 3 commits intoredis:mainfrom
kael-aiur:main

Conversation

@kael-aiur
Copy link
Copy Markdown

@kael-aiur kael-aiur commented Feb 10, 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
Changes stale-connection detection used during partition reconfiguration, which can affect connection lifecycle and traffic routing during failover. Scope is small and covered by a new unit test, but incorrect role detection could cause extra reconnects or missed closures.

Overview
Fixes stale-connection detection during cluster partition updates so cached connections are treated as stale when the node’s current role no longer matches the connection intent (e.g., a READ connection pointing at an upstream/master, or a WRITE connection pointing at a replica).

Adds a unit test ensuring a cached read-from-replica connection is closed when that replica is promoted to master after setPartitions().

Written by Cursor Bugbot for commit 160ebad. This will update automatically on new commits. Configure here.

@a-TODO-rov
Copy link
Copy Markdown
Contributor

Thanks @kael-aiur
Will review this soon.

@jit-ci
Copy link
Copy Markdown

jit-ci bot commented Mar 2, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

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 1 potential issue.

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

Comment thread src/main/java/io/lettuce/core/cluster/PooledClusterConnectionProvider.java Outdated
@kael-aiur
Copy link
Copy Markdown
Author

I think the test fail on redis 7.4 and 8.2 is appears to be a flaky test unrelated to my changes. The test failure is in scriptLoad() which is unrelated to the clusterMyId() fallback logic I modified?

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.

2 participants