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

RedisCacheConnectionPoolManager raises connections without limits #320

Closed
Aequitash opened this issue Aug 28, 2020 · 2 comments
Closed

RedisCacheConnectionPoolManager raises connections without limits #320

Aequitash opened this issue Aug 28, 2020 · 2 comments

Comments

@Aequitash
Copy link

I use StackExchange.Redis.Extensions.Core of version 6.3.4

On each failed request RedisCacheConnectionPoolManager will create new connections. For example it happens when redis database is disabled or invoked restart

Steps to reproduce:

  1. Run API endpoint which on every request will make any request to redis. RedisConfig.PoolSize is 2
  2. Enable Runner in postman which will hit this endpoint 10000 times without delay
  3. Run in redis CLI command "client list" -> there will be 2-5 connections
  4. Invoke redis reboot without disabling Runner
  5. When reboot will be finished run redis CLI command "client list" -> where will be ~20 connection. Which will be much more then expected when poolSize is 2

Expected: Same 2-5 connections

Reason:
In StateAwareConnection.ConnectionFailed method raised invalidateConnectionCallback which referenced to EmitConnection method of RedisCacheConnectionPoolManager. This method creates new connection on each failed request. But old connections will not be closed.

Possible workaround:

  1. Call Invalidate() method in ConnectionFailed
  2. Update Invalidate() method to use multiplexer?.Close() instead of multiplexer?.Dispose()
@Aequitash
Copy link
Author

Added PR: #321

imperugo added a commit that referenced this issue Sep 1, 2020
@Aequitash
Copy link
Author

Fixed in version 6.3.5

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

No branches or pull requests

1 participant