Bilal-S / iis2tomcat

AJP Connector between Internet Information Services (IIS) and Apache Tomcat
http://www.boncode.net/boncode-connector
49 stars 32 forks source link

IIS becomming unresponsive after recycling application pool running long requests. #113

Open paulneering opened 8 months ago

paulneering commented 8 months ago

Running Boncode for years now but so now and then having issues where IIS becomes unresponsive. First we thought it must have been a lucee memory issue, but after deep analysis this is what came up!

Running long-running requests (300 sec) while recycling the application pool will result in IIS becoming unresponsive.

Running versions .27-.41 Reproduction only working having the loglevel setting to 1. When setting is set to 0 we couldn't reproduce this error. So the conclusion maybe running old and new pool at the same time cause and error because the log file is locked by the old pool (proces) and can't be accessed by the second.

Notes:

Reproduce: Using a browser 1 request running 300 seconds 10 request running 30 seconds (after ending retrigger) 1 user clicking on the application

BonCodeAJP13.settings:

<Settings>
<Server>localhost</Server>
<Port>8009</Port>
<EnableRemoteAdmin>True</EnableRemoteAdmin>
<EnableHeaderDataSupport>True</EnableHeaderDataSupport>
<ForceSecureSession>False</ForceSecureSession>
<AllowEmptyHeaders>False</AllowEmptyHeaders>
<MaxConnections>5000</MaxConnections>
<tcpNoDelay>true</tcpNoDelay>
<PacketSize>65536</PacketSize>
<LogLevel>1</LogLevel>
<LogDir>C:\www\logs\boncode</LogDir>
<ModCFMLSecret>-------------------------------------------------------------</ModCFMLSecret>
</Settings>

Server.xml <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" maxThreads="5000" packetSize="65536"/>

Code:

<cffunction name="request300">
    <cfscript>
        setting requesttimeout = 310;
    </cfscript>
    <cfargument name="event" type="any" required="true">
    <cfset var i = 0>
    <cfloop from="1" to="300" index="i">
        <cfsleep time="1000">
        <cfdump var="stap #i#">
    <cfflush>
    </cfloop>
    <cfabort>
</cffunction>

<cffunction name="request30">
    <cfscript>
        setting requesttimeout = 310;
    </cfscript>
    <cfargument name="event" type="any" required="true">
    <cfset var i = 0>
    <cfloop from="1" to="30" index="i">
        <cfsleep time="1000">
        <cfdump var="stap #i#">
    <cfflush>
    </cfloop>
    <cfabort>
</cffunction>
Bilal-S commented 8 months ago

Thanks @paulneering will put it into the queue.