Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RedisTemplate executing exception is swallowed when release connection errors [DATAREDIS-1104] #1674

Closed
spring-projects-issues opened this issue Feb 21, 2020 · 1 comment

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Feb 21, 2020

Suo Lu opened DATAREDIS-1104 and commented

Problem

RedisTemplate.execute has try-finally block without catch. If anything wrong in finally RedisConnectionUtils.releaseConnection, the original error will be swallowed.

Scenario

The client side has "org.springframework.data.redis.RedisConnectionFailureException: Unknown reply" ([^err.log]) time to time, however RedisTemplate is thread-safe, have no idea what's wrong. Until I debug RedisTemplate.execute added catch block print, to get the real error “SocketTimeoutException: Read timed out”([^err_swallowed.log])

I reviewed the master branch code, same as reproduced version in related pieces


Affects: 2.1.15 (Lovelace SR15)

Attachments:

Backported to: 2.2.5 (Moore SR5), 2.1.16 (Lovelace SR16)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 25, 2020

Mark Paluch commented

Good point. Releasing a connection should not affect the code flow in terms of hiding the exception. It makes sense to process silently on close failures and log failures to the debug log for further investigation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants