Skip to content

Close UnifiedJedis transaction only if one is active - #3522

Open
Chaedie wants to merge 3 commits into
spring-projects:mainfrom
Chaedie:GH-3519-jedis-close-without-transaction
Open

Chaedie wants to merge 3 commits into
spring-projects:mainfrom
Chaedie:GH-3519-jedis-close-without-transaction

Conversation

@Chaedie

@Chaedie Chaedie commented Dec 2, 2026 •

Copy link
Copy Markdown

Closes #3519

UnifiedJedisDelegate.close() called getRequiredTransaction() even without an active transaction, so every close in RedisClient (UnifiedJedis) mode threw and swallowed an IllegalStateException. It now only discards and closes an active transaction.

  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

JFR, 1000 closes: 1000 exceptions before, 0 after.

gh-3519-evidence

The close path alone goes from 4.8 µs to 3.8 ns. End-to-end RedisCache throughput is unchanged, since Redis round trips dominate.

gh-3519-benchmark

Closes spring-projects#3519

Signed-off-by: Chaedong Im <88099590+Chaedie@users.noreply.github.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 2, 2026
@Chaedie
Chaedie force-pushed the GH-3519-jedis-close-without-transaction branch 2 times, most recently from 9164b1c to 455a89e Compare December 2, 2026 15:29
See spring-projects#3519

Signed-off-by: Chaedong Im <88099590+Chaedie@users.noreply.github.com>
See spring-projects#3519

Signed-off-by: Chaedong Im <88099590+Chaedie@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JedisConnection.close() throws and swallows IllegalStateException("Connection has no active transaction") on every cache operation

2 participants