Skip to content

ArgumentOutOfRangeException when accessing ConnectionMultiplexer log #1108

@paveliak

Description

@paveliak

Hi

I got an ArgumentOutOfRangeException exception when calling ToString() for the ConnectionMultiplexer log. From the code it looks like all writes to the TextWriter object are synchronized inside the StackExchange.Redis code so the only thing that comes into my mind is that writes might continue after Connect() method returns and then ToString() method collides with those writes. Does it sound plausible?

FWIW we are using v1.2.6.

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: chunkLength

at System.Text.StringBuilder.ToString()
at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
...

Here is our code:

var log = new StringWriter();
ConnectionMultiplexer mux = ConnectionMultiplexer.Connect(configurationOptions, log);
Trace($"ConnectionMultiplexerCreated: id={m_id}, log={log}");

Thanks,
Pavel

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