Constant Server respawning happens for me after the 15 minute ping timer from WindowsService to Server expires, provided the Server is not the original one which pings OK. See my speculation above that maybe forwarder code isn’t coded to run twice. I’m not certain why second Server pair dies, but a port 8200 conflict would be a plausible guess because lock conflict returns exit 200, whereas I’m getting exit 100 from the new child Server, passing up through new parent Server. The question was why the ping failure didn’t kill the old parent Server (and I wonder what would become of old child Server?), however the reason seems to be that the incomplete read task after 1 minute tries to be destroyed at “using” block end, but can’t be. I’m not sure why m_writeMessage didn’t log this to the event log (it logged Starting event but hasn’t logged later events), however debugger Output (which might be Console.Writeline) has this to say from the exception catch block:
16:59:25.336 Exception thrown: ‘System.InvalidOperationException’ in mscorlib.dll
16:59:25.336 Additional information: A task may only be disposed if it is in a completion state (RanToCompletion, Faulted or Canceled).
What this means is that the stack of original WindowsService, original Server, and updated Server is still hanging around, however WindowsService thinks Server went unresponsive, failed to kill it, and started restarting additional Server pairs which come up, go down, and keep on doing this (rate-limited though).
Note that all this is happening on the modified proof-of-concept version that’s running RealMain directly. Fixing forwarding was said to be a “fairly simple fix”, but other fixes include read timeout exception, return code out of Main, and possibly the oddity about why --debug-service seems to only work for a short time.
Recap of setup is base 220.127.116.11 with a test 18.104.22.168 WindowsService set for better debuggability, calling RealMain from Main. Remove 22.214.171.124 update, start service, Install 126.96.36.199, Activate, wait > 15 minutes before respawning extra Server stack starts, but forwarding (e.g. to shutdown) was probably bad earlier.