Thank you! WEBSITE_DISABLE_OVERLAPPED_RECYCLING=1 got us past the MainDom timeout issue.
We’re still seeing the server not come online on its own after restart (requires manual intervention), but that appears to be a separate issue we’re investigating.
IME it’s only necessary if this problem is encountered.
It really shouldn’t happen. When Overlapped Recycling is enabled two different VMs will temporarily run the site at the same time. So it’s a bit like you’re “load balancing”.
But in that scenario, so long as you are using FileSystemMainDomLock and EnvironmentTemp that shouldn’t matter - we should be talking about two separate machines with two separate sets of temp files so I really don’t know what’s going on.
I’ll give a shoutout to @Jeavon at this point, as he found out that during slot swaps temp files can kinda persist. IDK if the same sort of thing is happening here.
I feel like the proper way to address this is to have an extra nerdy look at the FileSystemMainDomLock and AspNetCoreHostingEnvironment.LocalTempPath and see if there’s something that can be done.
Frankly, I’m not sure why we have IMainDom and require a lock at all…
AFAIK in .NET5+ you can’t even have multiple App Domains running…