I was kind of embarrassed by this, and hoped that I would find a few answers here.
Basically, I have an ASP.NET application running on two servers. Server A has all the available business logic / data access in the form of web services, and server B has a website that talks about these services (via WCF with net.tcp binding).
The problem occurs a few seconds after IIS on server A. initiates a restart of my application pool. Recycling occurs after the allotted time (using the default 29 hours in IIS).
In the server log (server A):
Workflow with process identifier application pool #### '' AppPoolName "requested processing because the workflow has reached its allowable processing time.
I think this is normal behavior. The problem is that after a few seconds I get this exception on server B:
This channel can no longer be used to send messages as the output session was automatically closed due to server shutdown. Either turn off auto-closing by setting DispatchRuntime.AutomaticInputSessionShutdown to false or consider changing the shutdown protocol with a remote server.
This does not happen on every repetition; I suppose this happens when someone hits the site with a WHILE request when processing happens.
In addition, my application does not work until I intervene; this exception continues to occur every time the next request is made to the page. I intervene by editing web.config (adding a space or something benign at the end of the file) and saving it. I assume this forces my application to recompile and returns the services back. I also experimented with running a batch file that does this for me every time an exception occurs;)
Now I could hardly find information about this exception, and I was looking for a while. Most of the information I found relates to WCF settings, which I do not use.
I already read "DispatchRuntime.AutomaticInputSessionShutdown" and I do not think this applies to this situation. This particular property refers to disabling a service automatically in response to client-side behavior, which is not what happens here. Here the service is disconnected due to IIS.
I read this one that went through some work to automatically return the service, but I really want to understand what is happening here, and not hack it!
I started playing with the settings in IIS7, in particular turning on / off Overlapped Recycling and increasing the start / end time of the process. I am wondering if recirculation can be completely turned off (I suppose if I set 0 for the recirculation time interval?) But again, I want to know what happens!
In any case, if you need more information, let me know. Thanks in advance!