Skip to content

ArgumentOutOfRangeException thrown when setting MinPoolSize and MaxPoolSize programmatically #42

@eshenem

Description

@eshenem

It appears a bug is introduced in 2.0.4+ when MinPoolSize and MaxPoolSize are set via SocketPoolOptions (MemcachedClientOptions.cs) and MinPoolSize property in SocketPoolConfiguration.cs has a check to ensure it's less than MaxPoolSize. The issue is when both properties are set in SocketPoolOptions, it will throw ArgumentOutOfRangeException since the default values are 10 and 20 respectively and when I set 50 and 500, it will check MinPoolSize (50) against MaxPoolSize (20). It does not know about the new value yet.

Here's the example that will trigger the exception.

var c = new SocketPoolOptions { MinPoolSize = 50, MaxPoolSize = 500 };
var options = Options.Create(new MemcachedClientOptions { SocketPool = c });
var config = new MemcachedClientConfiguration(_loggerFactory, options);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions