Skip to content

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

Open
kael-aiur wants to merge 4 commits into
redis:mainfrom
kael-aiur:main
Open

fix bug: issue #3595 and add unit test #3661
kael-aiur wants to merge 4 commits into
redis: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 the stale-connection eviction logic for pooled cluster connections, which can affect when connections are closed during topology/role changes. Risk is moderate because it alters behavior during failover and could cause extra reconnects if misclassified.

Overview
Fixes stale pooled-connection detection during cluster reconfiguration by treating connections as stale when a node’s role no longer matches the connection intent (e.g., cached READ connection to a node that is now UPSTREAM, or WRITE connection to a node that is now REPLICA).

Adds a unit test covering replica promotion to master to ensure existing cached read connections are closed after setPartitions() updates the cluster view.

Reviewed by Cursor Bugbot for commit 69be339. Bugbot is set up for automated code reviews on this repo. 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