Skip to content
This repository was archived by the owner on Jun 20, 2019. It is now read-only.
This repository was archived by the owner on Jun 20, 2019. It is now read-only.

App pool recycle uses incorrect directory under stress #1

Closed
@natemcmaster

Description

@natemcmaster

Under high load, app pool recycling causes IIS to use the wrong directory when recycling applications within a website.

Repro

  1. Create three small ASP.NET Core 1.0 applications under one website.

    websiteroot/
        web.config
    apps/
        testapp1/
            web.config
        testapp2/
            web.config
        testapp3/
            web.config
    
    using System.IO;
    using System.Threading.Tasks;
    using Microsoft.AspNetCore.Builder;
    using Microsoft.AspNetCore.Hosting;
    using Microsoft.AspNetCore.Http;
    
    public class Startup
    {
        public void Configure(IApplicationBuilder app)
        {
            app.Run(async context =>
            {
                await Task.Delay(1000);
                await context.Response.WriteAsync("Echo");
            });
        }
    
        public static void Main(string[] args)
        {
            var host = new WebHostBuilder()
                    .UseContentRoot(Directory.GetCurrentDirectory())
                    .UseKestrel()
                    .UseIISIntegration()
                    .UseStartup<Startup>()
                    .Build();
    
            host.Run();
        }
    }
    <configuration>
        <system.webServer>
            <handlers>
                <add name='aspnetCore' path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
            </handlers>
            <aspNetCore processPath="dotnet" arguments='.\testapp1.dll' stdoutLogEnabled="false" forwardWindowsAuthToken="false"/>
        </system.webServer>
    </configuration>
  2. Create high load. I got this to repro with 10 threads constantly pulling at the three apps within the website.

  3. Wait for an app pool recycle to trigger (such as using the # of requests trigger, or time interval trigger).

Expected

ANCM should always use the appropriate app/testappN/ folder to start the app.

Actual

Not always, but somethings IIS uses websiteroot/ instead of app/testappN/ as the current working directory when starting the app. This causes perpetual 502.5 errors.

The application to execute does not exist: 'C:\inetpub\websiteroot\testapp1.dll'

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