Skip to content

Reset JedisConnectionFactory's destroyed flag when initializing bean #2554

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

Closed
wants to merge 1 commit into from

Conversation

Jiabao-Sun
Copy link

Reset JedisConnectionFactory's destroyed flag when initializing bean to prevent configuration hot upgrade issue.

Closes #2553

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 14, 2023
@Jiabao-Sun
Copy link
Author

Hi @mp911de,
Could you help review it when you have time?

@mp911de
Copy link
Member

mp911de commented Apr 17, 2023

We should revisit initialization in the scope of #2503

@mp911de mp911de added the status: blocked An issue that's blocked on an external project change label Apr 17, 2023
@jxblum
Copy link
Contributor

jxblum commented Jun 8, 2023

@Jiabao-Sun - I agree with @mp911de here. This needs to be considered carefully, and will likely and necessarily be tied to the Spring containers lifecycle management capabilities in support of our CRaC efforts.

I also don't necessarily think or agree that allowing the JedisConnectionFactory bean to be reused after it has already been destroyed is necessarily the correct thing to do, in any case. After all, this assertion has been in place for sometime (used before acquiring connections, for instance) and while there is not a good documented reason for it, it is not seemingly arbitrary either.

Additionally, whatever we do with the Jedis based connection support should be consistently applied to the Lettuce connection support as well.

While this may look safe on the surface that is Spring Data (Redis), you must also consider what occurs, or state that is held in the drivers.

Unfortunately, I would need to think on and test this with several arrangements as well as different contexts (e.g. Spring Boot application), to determine whether this would even be safe to do in a majority of the cases. There is a good/strong reason why the core Spring Framework team rejected this ticket of mine many moons ago, which is similar in concept.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: blocked An issue that's blocked on an external project change status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JedisConnectionFactory failed to get connection after configuration auto update
4 participants