I wrote a HttpPlatformHandler exe that works pretty well. I added code to exit the exe if it has been idle for 5 minutes. The exe does exit after 5 minutes but the next client request usually gets a Bad Gateway error. I was expecting that the handler would just start the exe.
The application pool has a timeout feature but if there is a request processing that takes longer than the timeout, it gets killed before completion.
Is there a way for the exe to end itself in a way that the handler can handle?