msbuild
msbuild copied to clipboard
Implement adaptive node timeout
Contributes to #9922
Context
MSBuild currently uses a fixed timeout of 15 minutes, after which idle nodes shut themselves down. This works well for cases where the build is invoked repeatedly and the nodes stay alive for a long time. However, for one-off builds the timeout may be perceived as excessive.
Changes Made
This PR makes the timeout "adaptive". We assume that the process is expected to live for about double it's current up time, meaning that the timeout automatically increases as the node is processing build requests. For example, if the process has been running for 5 minutes, we set the timeout for 5 minutes.
The default maximum timeout is 15 minutes and the default minimum timeout is 1 minute. Both can be overridden with environment variables.
Testing
Manual verification.