From a411caabf041dea837dcfa7da80663e7015c1d22 Mon Sep 17 00:00:00 2001 From: Jared Parsons Date: Mon, 1 Apr 2019 09:37:12 -0700 Subject: [PATCH] Fix publish error on Build.Server.Log When the optimization data isn't available our build will terminate with VBCSCompiler still being alive and holding a handle to Build.Server.Log. That handle causes an error during publishing. This error shouldn't happen as the file is open with `FileShare.ReadWrite` hence publish can access the file. This can be demonstrated locally by using any number of tools to open the file while a build is running. Likely publish is looking for exclusive access here and that's why the error occurs. In any case though we should be killing our spawned processes at the end of the job anyways in CI. Leaving behind server processes for the next run is just asking for trouble. https://github.com/Microsoft/azure-pipelines-tasks/issues/9994 --- eng/build.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eng/build.ps1 b/eng/build.ps1 index fd3ab1cad6d..93071973ed6 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -626,5 +626,8 @@ catch { ExitWithExitCode 1 } finally { + if ($ci) { + Stop-Processes + } Pop-Location } -- GitLab