-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Error Trace:
java.lang.IllegalStateException: JedisConnectionFactory was destroyed and cannot be used anymore## at org.springframework.util.Assert.state(Assert.java:76) ~[spring-core-5.3.23.jar!/:5.3.23]## at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.assertInitialized(JedisConnectionFactory.java:971) ~[spring-data-redis-2.7.3.jar!/:2.7.3]## at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:509) ~[spring-data-redis-2.7.3.jar!/:2.7.3]## at org.springframework.data.redis.core.RedisConnectionUtils.fetchConnection(RedisConnectionUtils.java:193) ~[spring-data-redis-2.7.3.jar!/:2.7.3]## at org.springframework.data.redis.core.RedisConnectionUtils.doGetConnection(RedisConnectionUtils.java:144)
We receive EnvironmentChangeEvent
in the configuration hot update scenario.
The ConfigurationPropertiesRebinder
will destroy and reinitialize JedisConnectionFactory
.
In destroy method we set the destroyed flag as true.
But in initial method (afterPropertiesSet) we don't reset destroyed as false.
This will cause us to be unable to get a connection from the JedisConnectionFactory
any more.