Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ghost processes after initial build #14988

Closed
nojaf opened this issue Mar 28, 2023 · 3 comments
Closed

Ghost processes after initial build #14988

nojaf opened this issue Mar 28, 2023 · 3 comments

Comments

@nojaf
Copy link
Contributor

nojaf commented Mar 28, 2023

Apologies for not reporting this sooner but I fear I still found a problem after #14677.

Repro steps

  • Fresh clone of the repository.
  • dotnet build Fsharp.Compiler.Service.sln
  • PowerShell: Get-Process -Name "dotnet" | Select-Object Id,Name,StartTime,CommandLine

Expected behavior

There shouldn't be any lingering dotnet processes after that initial build.
When doing a rebuild or -c Release fslex could be stuck because of a lock.

Actual behavior

image

Known workarounds

Kill all the processes: Get-Process -Name "dotnet" | Kill

@github-actions github-actions bot added this to the Backlog milestone Mar 28, 2023
@baronfel
Copy link
Member

These mostly look to be MSBuild worker nodes - these stay around on purpose, but they shouldn't be locking any assemblies since those assemblies should be unloaded after a build. If this is causing actual problems you should be able to force them all to shut down with dotnet build-server shutdown.

@nojaf
Copy link
Contributor Author

nojaf commented Mar 28, 2023

Interesting, I am seeing this:

C:\Program Files\dotnet\sdk\7.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(292,5): error MSB4018: The "GenerateRuntimeConfigurationFiles" task failed unexpectedly. [C:\Users\nojaf\Projects\fsharp\buildtools\fslex\fslex.fsproj]
C:\Program Files\dotnet\sdk\7.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(292,5): error MSB4018: System.IO.IOException: The process cannot access the file 'C:\Users\nojaf\Projects\fsharp\artifacts\bin\fslex\Debug\net7.0\fslex.runtim
econfig.json' because it is being used by another process. [C:\Users\nojaf\Projects\fsharp\buildtools\fslex\fslex.fsproj]
C:\Program Files\dotnet\sdk\7.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(292,5): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOpt
ions options) [C:\Users\nojaf\Projects\fsharp\buildtools\fslex\fslex.fsproj]
C:\Program Files\dotnet\sdk\7.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(292,5): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions o
ptions, Int64 preallocationSize, Nullable`1 unixCreateMode) [C:\Users\nojaf\Projects\fsharp\buildtools\fslex\fslex.fsproj]
C:\Program Files\dotnet\sdk\7.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(292,5): error MSB4018:    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions optio
ns, Int64 preallocationSize, Nullable`1 unixCreateMode) [C:\Users\nojaf\Projects\fsharp\buildtools\fslex\fslex.fsproj]
C:\Program Files\dotnet\sdk\7.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(292,5): error MSB4018:    at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOpt
ions options, Int64 preallocationSize, Nullable`1 unixCreateMode) [C:\Users\nojaf\Projects\fsharp\buildtools\fslex\fslex.fsproj]
C:\Program Files\dotnet\sdk\7.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(292,5): error MSB4018:    at System.IO.File.Create(String path) [C:\Users\nojaf\Projects\fsharp\buildtools\fslex\fslex.fsproj]
C:\Program Files\dotnet\sdk\7.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(292,5): error MSB4018:    at Microsoft.NET.Build.Tasks.GenerateRuntimeConfigurationFiles.WriteToJsonFile(String fileName, Object value) [C:\Users\nojaf\Projec
ts\fsharp\buildtools\fslex\fslex.fsproj]
C:\Program Files\dotnet\sdk\7.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(292,5): error MSB4018:    at Microsoft.NET.Build.Tasks.GenerateRuntimeConfigurationFiles.WriteRuntimeConfig(RuntimeFramework[] runtimeFrameworks, LockFileTarg
etLibrary platformLibrary, Boolean isFrameworkDependent, IList`1 packageFolders) [C:\Users\nojaf\Projects\fsharp\buildtools\fslex\fslex.fsproj]
C:\Program Files\dotnet\sdk\7.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(292,5): error MSB4018:    at Microsoft.NET.Build.Tasks.GenerateRuntimeConfigurationFiles.ExecuteCore() [C:\Users\nojaf\Projects\fsharp\buildtools\fslex\fslex.
fsproj]
C:\Program Files\dotnet\sdk\7.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(292,5): error MSB4018:    at Microsoft.NET.Build.Tasks.TaskBase.Execute() [C:\Users\nojaf\Projects\fsharp\buildtools\fslex\fslex.fsproj]
C:\Program Files\dotnet\sdk\7.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(292,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\Users\nojaf\Projects\fsharp\bu
ildtools\fslex\fslex.fsproj]
C:\Program Files\dotnet\sdk\7.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(292,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingC
ontext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [C:\Users\nojaf\Projects\fsharp\buildtools\fslex\fslex.fsproj]

Building the solution again does resolve the problem.

@vzarytovskii
Copy link
Member

So, at this point, we don't do anything extra, just a normal dotnet build, no special tasks or anything, so it's likely unrelated to F#.

@dotnet dotnet locked and limited conversation to collaborators Mar 28, 2023
@vzarytovskii vzarytovskii converted this issue into discussion #14990 Mar 28, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
Archived in project
Development

No branches or pull requests

3 participants