IIS 7 Worker Process hanging with shared app pool. one of the two sites works fine

857 Views Asked by At

I have two websites which share an App Pool .Net V4.0 Integrated.
One site is ASP.NET MVC 4 and the other is VB.NET Website

They share login information and Server Sessions by both containing the following in the web.config

<authentication mode="Forms">
  <forms loginUrl="http://www.example.com/login.aspx" name=".MYCUSTOMAUTH" protection="All" path="/" domain=".example.com" timeout="30" />
</authentication>
<httpCookies domain=".example.com" />
<sessionState mode="StateServer" stateConnectionString="tcpip=loopback:42424" />
<machineKey validationKey="XXX" decryptionKey="XXX" validation="SHA1" />

I am also setting the application names in the global.asax Application_Start using the following:

FieldInfo runtimeInfo = typeof(HttpRuntime).GetField("_theRuntime", BindingFlags.Static | BindingFlags.NonPublic);
HttpRuntime theRuntime = (HttpRuntime)runtimeInfo.GetValue(null);
FieldInfo appNameInfo = typeof(HttpRuntime).GetField("_appDomainAppId", BindingFlags.Instance | BindingFlags.NonPublic);
appNameInfo.SetValue(theRuntime, "MyApplicationName");

The main site located at www.example.com show a login screen, on correct login an object session is create and the user is redirected to subdomain.example.com.
The issue is that the Worker thread just hangs indefinitely maxing the each thread. This setup worked correctly when I left at 6:00pm last night but when I tried to login at 9:00am this morning it has no stopped working.

I have re-deployed both sites, recycled the app pools, deleted and created new app pools, restarted the ASP.NET State Service. Everything sort of restarting the whole IIS Service, which is not really an option until Sunday 3:00am...
Also even though restarting the IIS server could resolve the problem temporally it would not be something that could be done on a daily basis if the problem continued.

Additionally the server never times out the connection and no Errors or Warning are ever produced in the event log unless I manually end the process.

1

There are 1 best solutions below

0
On

They do need to be in the same application pool for them to share session information Does it hang immediately after recycling the app pool if you try it?

You need to identify the action that is causing it to hang - ( e.g button click on login on either site ). Why are you using customauth and not forms auth?