spring-projects / spring-session

Spring Session
https://spring.io/projects/spring-session
Apache License 2.0
1.86k stars 1.11k forks source link

config command leaks #626

Closed hikoma closed 7 years ago

hikoma commented 8 years ago

I use spring-session 1.2.1 with springboot 1.4.0. I check client list using redis-cli, config command does not closed.

127.0.0.1:6379> client list
id=388 addr=127.0.0.1:37054 fd=5 name= age=682 idle=667 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=config

I guess EnableRedisKeyspaceNotificationsInitializer should be close after configure.

    static class EnableRedisKeyspaceNotificationsInitializer implements InitializingBean {
        private final RedisConnectionFactory connectionFactory;

        private ConfigureRedisAction configure;

        EnableRedisKeyspaceNotificationsInitializer(
                RedisConnectionFactory connectionFactory,
                ConfigureRedisAction configure) {
            this.connectionFactory = connectionFactory;
            this.configure = configure;
        }

        public void afterPropertiesSet() throws Exception {
            RedisConnection connection = this.connectionFactory.getConnection();
            this.configure.configure(connection);
        }
    }
rwinch commented 7 years ago

Closed via 802e0e7