Skip to content

Drop deprecated classes and constructors - #4488

Merged
uglide merged 12 commits into
masterfrom
im/drop-deprecated-classes
Apr 21, 2026
Merged

uglide merged 12 commits into
masterfrom
im/drop-deprecated-classes

Conversation

@uglide

@uglide uglide commented Apr 16, 2026 •

Copy link
Copy Markdown
Contributor

Removes JedisPooled and JedisSentineled that have been replaced by RedisClient and RedisSentinelClient and removes deprecated UnifiedJedis constructors

JedisCluster is kept for compatibility with SDR 4.x


Note

Medium Risk
Removes public deprecated classes/constructors and rewires JedisCluster initialization, which can break downstream code that still referenced these APIs despite deprecations. Behavioral risk is moderate but mostly limited to construction paths and tests/docs updates.

Overview
Removes the deprecated JedisPooled and JedisSentineled classes, along with several deprecated UnifiedJedis public constructors, further consolidating client creation around RedisClient/RedisSentinelClient and builder-based configuration.

Updates JedisCluster constructors to explicitly construct a ClusterCommandExecutor/ClusterCommandObjects rather than delegating to now-removed UnifiedJedis cluster constructors, and adjusts builder defaults to reference RedisClusterClient.DEFAULT_MAX_ATTEMPTS.

Refreshes docs/tests to stop instantiating deprecated clients directly, including a new Advanced Usage section documenting Unix Domain Socket connections via a custom JedisSocketFactory + PooledConnectionProvider.

Reviewed by Cursor Bugbot for commit 0d4029d. Bugbot is set up for automated code reviews on this repo. Configure here.

@uglide
uglide requested review from ggivo and tishun April 16, 2026 09:03
@uglide uglide added the breakingchange Pull request that has breaking changes. Must include the breaking behavior in release notes. label Apr 16, 2026
@uglide uglide added this to the 8.0.0 milestone Apr 16, 2026
@github-actions

github-actions Bot commented Apr 16, 2026 •

Copy link
Copy Markdown

Test Results

β€‡β€ˆ191 files  ± 0β€‚β€ƒβ€‡β€ˆ191 suites  Β±0   11m 37s ⏱️ -1s
9β€ˆ221 tests + 6  9β€ˆ003 βœ… +252  218 πŸ’€  -β€Š246  0 ❌ Β±0 
3β€ˆ461 runsβ€Š +12  3β€ˆ397 βœ… + 99   64 πŸ’€  -β€Šβ€‡87  0 ❌ Β±0 

Results for commit 0d4029d. ± Comparison against base commit 64c3e96.

This pull request removes 1 and adds 7 tests. Note that renamed tests count towards both.
redis.clients.jedis.commands.unified.search.FTHybridCommandsTestBase$SupportedScorersTest ‑ testScorer(Scorer, double, double)
redis.clients.jedis.commands.unified.search.FTHybridCommandsTestBase$SupportedScorersTest ‑ testScorer(Scorer, double, double)[1]
redis.clients.jedis.commands.unified.search.FTHybridCommandsTestBase$SupportedScorersTest ‑ testScorer(Scorer, double, double)[2]
redis.clients.jedis.commands.unified.search.FTHybridCommandsTestBase$SupportedScorersTest ‑ testScorer(Scorer, double, double)[3]
redis.clients.jedis.commands.unified.search.FTHybridCommandsTestBase$SupportedScorersTest ‑ testScorer(Scorer, double, double)[4]
redis.clients.jedis.commands.unified.search.FTHybridCommandsTestBase$SupportedScorersTest ‑ testScorer(Scorer, double, double)[5]
redis.clients.jedis.commands.unified.search.FTHybridCommandsTestBase$SupportedScorersTest ‑ testScorer(Scorer, double, double)[6]
redis.clients.jedis.commands.unified.search.FTHybridCommandsTestBase$SupportedScorersTest ‑ testScorer(Scorer, double, double)[7]

♻️ This comment has been updated with latest results.

@jit-ci

jit-ci Bot commented Apr 16, 2026 •

Copy link
Copy Markdown

πŸ›‘οΈ Jit Security Scan Results

CRITICAL HIGH MEDIUM

βœ… No security findings were detected in this PR


Security scan by Jit

@uglide
uglide force-pushed the im/drop-deprecated-classes branch from 5f08848 to bd5bb35 Compare April 16, 2026 09:30
@uglide
uglide requested a review from atakavci April 16, 2026 10:25
@uglide uglide changed the title Drop duplicating deprecated classes Drop deprecated classes and constructors Apr 16, 2026
public void test() {
ManagedConnectionProvider managed = new ManagedConnectionProvider();
try (UnifiedJedis jedis = new UnifiedJedis(managed)) {
try (UnifiedJedis jedis = new UnifiedJedis(managed, RedisProtocol.RESP2)) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering if there is a reason for RESP2 explicitly

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR removes UnifiedJedis(ConnectionProvider provider) constructor :)

// We want to be accurate about our mocks, hence we verify no more interactions here.
// This might mean that some methods need to verify their interactions in a more verbose way,
// but overall the benefit should be greater than the cost.
verify(connectionProvider).getConnection();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for removing this verification step?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've replaced usage of UnifiedJedis(CommandExecutor executor, ConnectionProvider provider, CommandObjects commandObjects) constructor with RedisClient builder above and we don't call the same code path anymore, so connection is no longer acquired from the ConnectionProvider to verify the RESP version.

Comment on lines 40 to 51
public void unifiedJedisConnectsToUds() {
try (UnifiedJedis jedis = new UnifiedJedis(new UdsJedisSocketFactory())) {
try (UnifiedJedis jedis = new UnifiedJedis(new Connection(new UdsJedisSocketFactory()))) {
assertEquals("PONG", jedis.ping());
}
}

@Test
public void unifiedJedisConnectsToUdsResp3() {
try (UnifiedJedis jedis = new UnifiedJedis(new UdsJedisSocketFactory(),
DefaultJedisClientConfig.builder().resp3().build())) {
try (UnifiedJedis jedis = new UnifiedJedis(new Connection(new UdsJedisSocketFactory(),
DefaultJedisClientConfig.builder().resp3().build()))) {
assertEquals("PONG", jedis.ping());
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This made me think that we do not provide a documented migration path when using new clients via builders to configure/use a custom socket factory. For example, in this case, for using UDS sockets.

One option as a workaround, users can configure it on a connection provider and then use the factory to create a client with the connection provider.

Since we are also removing JedisPooled, we should document the workaround as a migration path or provide an OOB way to provide a custom socket factory

There is actually a similar discussion recently opened: #4477

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the documentation on how to use UDS with RedisClient

tishun
tishun previously approved these changes Apr 21, 2026

@tishun tishun left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the perspective of SDR : I've replaced the JEdis dependency with the one generated from this branch and there are 0 compilation errors and 0 test failures (including integration tests)

@VisibleForTesting
@Deprecated
public UnifiedJedis(CommandExecutor executor, ConnectionProvider provider, CommandObjects commandObjects) {
protected UnifiedJedis(CommandExecutor executor, ConnectionProvider provider, CommandObjects commandObjects) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I would even go further and make it with package-private (default) visibility

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, I think it's a safer choice to allow apps to use this constructor in their child classes as a workaround if needed.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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.

Fix All in Cursor

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

Reviewed by Cursor Bugbot for commit 0d4029d. Configure here.

@ggivo ggivo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@uglide
uglide merged commit 9aac909 into master Apr 21, 2026
17 checks passed
@uglide
uglide deleted the im/drop-deprecated-classes branch April 21, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breakingchange Pull request that has breaking changes. Must include the breaking behavior in release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants