Skip to content

IndexOutOfRangeException in Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.ExtraFeatureSet #56762

Open
@zlatanov

Description

@zlatanov

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Sometimes we get the following error logged:

IndexOutOfRangeException: Index was outside the bounds of the array.
    at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.ExtraFeatureSet(Type key, Object value)
    at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)

Looking at the code there, I can't find anything that would cause this error if the code there is not accessed concurrently. Is it possible that, if a connection is aborted while for example the ResponseCompressionMiddleware is being executed, that this ExtraFeatureSet might get executed concurrently?

Expected Behavior

No exception to occur.

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

8.0.2

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsfeature-iisIncludes: IIS, ANCM

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions