Aias00 opened a new issue, #6877:
URL: https://github.com/apache/shenyu/issues/6877

   ## Description
   `handlerPlugin` checks if the new `RedisConfigProperties` differs from the 
cached singleton. If it differs, it constructs a new `RedisConnectionFactory` 
(which opens Lettuce connection pools via `afterPropertiesSet()`), stores the 
new `ReactiveRedisTemplate` and `RedisConfigProperties` into `Singleton.INST`, 
but never calls `destroy()` on the OLD `LettuceConnectionFactory`. The old 
factory's connection pool (sockets, NIO event loops, threads) is orphaned. 
Trigger: any admin update that changes the redis URL, password, database, or 
pool settings.
   
   ## Location
   - 
`shenyu-plugin/shenyu-plugin-fault-tolerance/shenyu-plugin-ratelimiter/src/main/java/org/apache/shenyu/plugin/ratelimiter/handler/RateLimiterPluginDataHandler.java:50-65`
   - 
`shenyu-infra/shenyu-infra-redis/src/main/java/org/apache/shenyu/infra/redis/RedisConnectionFactory.java:43-48`
   
   ## Impact
   Each redis config change permanently leaks a Lettuce connection pool. 
Repeated config updates accumulate leaked connections, eventually exhausting 
file descriptors / sockets and degrading gateway stability.
   
   ## Suggested fix
   Before installing the new factory, retrieve the old `ReactiveRedisTemplate` 
from `Singleton.INST`, extract its `LettuceConnectionFactory` (or track the old 
`RedisConnectionFactory`), and call `destroy()` on it before 
`Singleton.INST.single(...)`.
   
   ## Related existing
   None — distinct from #6645 (`RedisRateLimiter` fail-open) because this is a 
resource-leak in the data handler's config-update path, not the rate-limiting 
execution path.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to