Skip to content

Conversation

shivincible
Copy link

Fixes a NullPointerException when maxAttempts = 0 in RetryableCommandExecutor. When no retries are allowed, lastException remains null, and calling addSuppressed(lastException) throws: java.lang.NullPointerException: Cannot suppress a null exception

This fix checks for null before suppressing.
Reproducible with:
JedisCluster jedis = new JedisCluster( new HostAndPort("localhost", 6379), 2000, // connection timeout 2000, // soTimeout 0, // maxAttempts null, // password new JedisPoolConfig() ); jedis.set("key", "value"); // NPE thrown

Confirmed on: Jedis 3.9.0
master branch (RetryableCommandExecutor.java#L71

@shivincible shivincible marked this pull request as draft June 26, 2025 09:12
@shivincible shivincible marked this pull request as draft June 26, 2025 09:12
@shivincible shivincible marked this pull request as ready for review June 26, 2025 09:14
@shivincible
Copy link
Author

cc @atakavci

@ggivo
Copy link
Collaborator

ggivo commented Jun 26, 2025

Superseded by #4186

1 similar comment
@ggivo
Copy link
Collaborator

ggivo commented Jun 26, 2025

Superseded by #4186

@ggivo ggivo closed this Jun 26, 2025
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.

3 participants