GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||
GeezerVison is showing github.com — Fix connection leak in scanIteration with JedisSentineled #4323 by ggivo · Pull Request #4328 · redis/jedis Conversation
Collaborator
ProblemWhen using
SolutionOverride @Override public Map<?, Pool<Connection>> getConnectionMap() { return Collections.singletonMap(currentMaster, pool); } @Override public Map<?, Pool<Connection>> getPrimaryNodesConnectionMap() { return Collections.singletonMap(currentMaster, pool); } This allows Note on volatile pool: The iteration captures the pool reference at construction time. Connections from the old pool remain valid even if failover occurs during iteration. Note on returning a
Fixes #4323
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…sing failover client Override getConnectionMap() in SentineledConnectionProvider to return the pool instead of a raw connection. This prevents connection leaks when using scanIteration() with JedisSentineled. Fixes #4323
|
There was an error while loading. Please reload this page.
Test Results 280 files + 1 280 suites +1 11m 29s ⏱️ -14s Results for commit d296279. ± Comparison against base commit 1d8d075. This pull request skips 1011 tests.♻️ This comment has been updated with latest results. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This PR fixes a connection leak issue in SentineledConnectionProvider when using scanIteration() operations. The problem occurred because connections were allocated from the pool but never returned.
getConnectionMap() and getPrimaryNodesConnectionMap() to return the pool instead of raw connectionsCopilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
SentineledConnectionProvider.java |
Implements pool-based connection maps to prevent leaks |
SentineledConnectionProviderTest.java |
Adds unit tests verifying no connection leaks occur |
SentinelAllKindOfValuesCommandsIT.java |
Adds integration test class for sentinel command operations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
❌ The following Jit checks failed to run:
#jit_bypass_commit in this PR to bypass, Jit Admin privileges required.
More info in the Jit platform.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
* docs: document required optional dependency `resilience4j-all` when using failover client * Fix connection leak in scanIteration with JedisSentineled Override getConnectionMap() in SentineledConnectionProvider to return the pool instead of a raw connection. This prevents connection leaks when using scanIteration() with JedisSentineled. Fixes #4323 (cherry picked from commit 4ddd7f4)
… (#4352) * docs: document required optional dependency `resilience4j-all` when using failover client * Fix connection leak in scanIteration with JedisSentineled Override getConnectionMap() in SentineledConnectionProvider to return the pool instead of a raw connection. This prevents connection leaks when using scanIteration() with JedisSentineled. Fixes #4323 (cherry picked from commit 4ddd7f4)
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
ScanIteration (JedisCommandIterationBase) connection leak with JedisSentineled
There was an error while loading. Please reload this page.