Skip to content

Ask to extend ConnectionMultiplexer.IncludeDetailInExceptions check to more places #1967

@ORuban

Description

@ORuban

ConnectionMultiplexer currently has a IncludeDetailInExceptions flag with the following description

        /// <summary>
        /// Should exceptions include identifiable details? (key names, additional .Data annotations)
        /// </summary>
        public bool IncludeDetailInExceptions { get; set; }

which expected to mean that when IncludeDetailInExceptions=True on multiplexer, it might include command and key, otherwise only command.

Though, it is still possible to receive error messages like below when flag is disabled:

UnableToResolvePhysicalConnection on UNLINK Redis-Key, unable to write batch"

based on code, it may happen due to below logic in ResultProcessor class that doesn't check IncludeDetailInExceptions flag:

public void ConnectionFail(Message message, ConnectionFailureType fail, Exception innerException, string annotation)
{
	PhysicalConnection.IdentifyFailureType(innerException, ref fail);

	string exMessage = fail.ToString() + (message == null ? "" : (" on " + (
		fail == ConnectionFailureType.ProtocolFailure ? message.ToString() : message.CommandAndKey)));
	if (!string.IsNullOrWhiteSpace(annotation)) exMessage += ", " + annotation;

	var ex = innerException == null ? new RedisConnectionException(fail, exMessage)
		: new RedisConnectionException(fail, exMessage, innerException);
	SetException(message, ex);
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions