Skip to content

HttpSysRequestDelegationFeature - DelegationRule.Dispose() - Call to HttpCloseUrlGroup Fails with result ERROR_INVALID_PARAMETER #26989

@NGloreous

Description

@NGloreous

Describe the bug

I'm still looking into the details of why this is failing with a result of 87 (ERROR_INVALID_PARAMETER). Regardless I'm not even sure this call should be made for cases when the caller attached to the URL group because it was created by someone else.

To Reproduce

Need to run this code on a preview version of vNext Windows and you'll also need the fix in PR #26983 otherwise you'll hit the nullref issue.

namespace Sample
{
    public class Startup
    {
        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostApplicationLifetime lifetime, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            
            var delegator = app.ServerFeatures.Get<IServerDelegationFeature>();
            var rule = delegator.CreateDelegationRule("DefaultAppPool", "http://*:80/");
            rule.Dispose();
        }
    }
}

Exceptions (if any)

fail: Microsoft.AspNetCore.Server.HttpSys.MessagePump[21]
      HttpCloseUrlGroup; Result: 87

Metadata

Metadata

Assignees

Labels

affected-fewThis issue impacts only small number of customersarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsbugThis issue describes a behavior which is not expected - a bug.severity-minorThis label is used by an internal tool

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions