Conversation
…ed too frequently in ClusterPipeline
Test Results 176 files ± 0 176 suites ±0 11m 1s ⏱️ +45s Results for commit 38fa2a5. ± Comparison against base commit a3cfede. This pull request removes 1 and adds 10 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
There was a problem hiding this comment.
Pull request overview
This PR adds an option for Redis Cluster pipelining to reuse a caller-provided ExecutorService, avoiding the overhead of creating/shutting down a thread pool on every multi-node sync().
Changes:
- Added
pipelined(ExecutorService)overloads toRedisClusterClientandJedisCluster. - Updated
MultiNodePipelineBase/ClusterPipelineto accept and use an optional shared executor for multi-nodesync(). - Added tests validating shared-executor lifecycle behavior and concurrent pipeline usage.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/main/java/redis/clients/jedis/RedisClusterClient.java |
Adds pipelined(ExecutorService) API and delegates existing pipelined() to it. |
src/main/java/redis/clients/jedis/JedisCluster.java |
Adds pipelined(ExecutorService) API (deprecated client) and delegates existing pipelined() to it. |
src/main/java/redis/clients/jedis/MultiNodePipelineBase.java |
Implements shared-vs-dedicated executor selection and avoids shutting down shared executors. |
src/main/java/redis/clients/jedis/ClusterPipeline.java |
Wires the optional executor through to the base pipeline implementation. |
src/test/java/redis/clients/jedis/ClusterPipeliningTest.java |
Adds coverage for shared-executor behavior and concurrency/deadlock regression. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
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.
atakavci
left a comment
There was a problem hiding this comment.
MultiNodePipelineBase is somewhat in need of care in general.
but approving if you like to proceed with this PR as is.

Problem
Multi-node cluster pipelines create a new
ExecutorServiceon everysync()call, causing significant overhead in high-throughput scenarios.Solution
Added support for externally managed
ExecutorServicein cluster pipelines:cluster.pipelined(ExecutorService)- allows users to provide a shared executorcluster.pipelined()retains existing auto-managed behaviorImplementation
MultiNodePipelineBaseto accept optionalExecutorServicepipelined(ExecutorService)methods toRedisClusterClientandJedisClusterUsage Example:
Closes #4141
Note
Medium Risk
Changes the concurrency/executor lifecycle for multi-node cluster pipelining; incorrect executor management or shared-executor contention could impact performance or cause hangs, though behavior is covered by new integration tests.
Overview
Cluster pipelining can now reuse a caller-provided
ExecutorServiceinstead of creating/shutting down a thread pool on every multi-nodesync().MultiNodePipelineBaseaccepts an optional shared executor and only shuts down internally-created executors, whileJedisClusterandRedisClusterClientaddpipelined(ExecutorService)(withpipelined()delegating to it) to pass the executor through toClusterPipeline. New integration tests verify the shared executor is not shut down and that many concurrent pipelines sharing a small executor complete without deadlock.Written by Cursor Bugbot for commit 38fa2a5. This will update automatically on new commits. Configure here.