Problem with app pool

Михаил Андросов 481 Reputation points
2026-11-21T14:49:21.8566667+00:00

We are using Microsoft Windows Server 2012 R2.

The IIS application is running as a pool.

The app pool stops before updating. Sometimes there is a situation when the pool stops, but the task in the Task Manager remains hanging. When trying to remove it, the Access Denied error occurs.

I tried using the command
taskkill /F /PID
and remove the hung process. But an error occurs:

ERROR: The process with PID 7468 could not be terminated. Reason: There is no running instance of the task.

Typical of a zombie process.

When the pool starts, a new process is started. However, it does not work because the old hung process has occupied the grpc server port.

I don't know how to help the developers without restarting the server.

Windows development | Internet Information Services
0 comments No comments

1 answer

Sort by: Oldest
  1. AI answer

    2026-11-21T14:49:44.7366667+00:00

    The immediate path is to confirm whether the old IIS worker process is actually crashed, stuck during shutdown, or only appears as a stale PID.

    1. Check the real cause in Event Viewer.
      • On the server, open Run with Win+R, type eventvwr, and open Event Viewer.
      • In the Application log, look for:
        • Application Error, Event ID 1000
        • .NET Runtime, Event ID 1026
      • For IIS worker process failures, focus on w3wp.exe as the faulting application.
      • Record the Faulting module name and Exception code.
    2. Interpret the exception code.
      • 0xC0000005: access violation.
      • 0xe0434352: unhandled CLR exception in application code. Check the matching .NET Runtime 1026 event details, especially Description and Exception Info.
      • 0xC00000fd: stack overflow, commonly caused by infinite recursion.
    3. Capture a dump of the affected w3wp.exe instead of trying to force-kill it repeatedly.
      • This is the most useful way to help developers identify why the old process is hanging onto the gRPC port.
      • Safer options from the documented workflow are:
        • Windows Error Reporting (WER) first
        • Debug Diagnostic Tool
        • ProcDump
    4. Start with WER.
      • Check Event Viewer for Windows Error Reporting events.
      • Look in the directories named in those events for .mdmp or .hdmp files.
      • If dumps already exist, provide them to the developers or support.
      • If not, configure HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps with:
        • DumpFolder = path on a non-system drive with enough space
        • DumpCount = 3
        • DumpType = 2 for a full dump
      • Warning: registry changes are risky. Back up the relevant key first and use a non-system drive for dump storage.
    5. If the problem must be reproduced, use ProcDump on the IIS worker process.
      • Download ProcDump.
      • Extract it to a folder on a drive other than the system drive.
      • Open Command Prompt as administrator.
      • In IIS Manager:
        • select the server
        • open Worker Processes
        • note the PID for the affected w3wp.exe
      • Run:
             procdump -ma -e 1 -f "<typeOfException>" PID
        
      • -ma captures a full dump, -e 1 captures on first exception, and -f filters by exception type.
    6. If the issue happens during app pool shutdown, check shutdown timing.
      • IIS application pools need time to finish in-flight requests during shutdown.
      • If ShutdownTimeLimit was reduced too far from the default 90 seconds, IIS can log shutdown-related warnings and the pool may not stop cleanly under load.
      • If long-running requests are expected, increase ShutdownTimeLimit and capture a dump of w3wp.exe while the shutdown problem is occurring.
    7. About taskkill reporting “process not found”.
      • On Windows Server 2012 / 2012 R2 under heavy load, Taskkill.exe /PID <pid> can fail with:
        • ERROR: The process "<pid>" not found.
      • That behavior is documented, so this result alone does not prove the process is gone cleanly.
    8. After a dump is collected, analyze it.
      • Open DebugDiag2 Analysis.
      • Use Add Data Files to load the dump.
      • Run Start Analysis.
      • In the report:
        • for 0xC0000005, find the failing call stack and identify application code
        • for 0xC00000fd, look for repeating functions indicating recursion
        • for 0xe0434352, identify the call stack returning the application exception

    This gives developers actionable evidence without immediately restarting the server. The key step is collecting a dump from the hung or crashing w3wp.exe and correlating it with Application Error 1000 / .NET Runtime 1026 events.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.