Skip to content
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

[Bug]: Copy Task retries aren't useful in Terminal Logger #9658

Closed
baronfel opened this issue Jan 17, 2024 · 1 comment · Fixed by #10296
Closed

[Bug]: Copy Task retries aren't useful in Terminal Logger #9658

baronfel opened this issue Jan 17, 2024 · 1 comment · Fixed by #10296
Assignees
Labels
Area: Terminal Logger Problems with the livelogger/fancylogger/terminallogger -tl functionality. bug Priority:2 Work that is important, but not critical for the release triaged
Milestone

Comments

@baronfel
Copy link
Member

Issue Description

When the Copy Task logs warnings those warnings are held back by Terminal Logger until the entire build of that relevant project finishes. This means a viewer has no opportunity to see those messages and quickly kill the offending process, making them slightly less useful, and mostly just noisy in the final output.

Steps to Reproduce

It's really easy to reproduce in the SDK:

  • clone the SDK
  • run build.cmd
  • run artifacts/sdk-build-env.ps1
  • launch VS Code
  • run dotnet build on the src/Layout/redist project

Expected Behavior

The copy errors should be visible to the user in some form earlier than the build finishing.

Actual Behavior

The errors are buffered and emitted as a single unit:

$ dotnet build

MSBuild version 17.10.0-preview-24060-03+1725b247e for .NET
Restore complete (1.6s)
  toolset-tasks net472 succeeded (1.0s) → E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net472\toolset-tasks.dll
  toolset-tasks net8.0 failed with errors (13.2s)
    C:\Program Files\dotnet\sdk\9.0.100-alpha.1.24067.4\Microsoft.Common.CurrentVersion.targets(4787,5): warning MSB3026: Could not copy "E:\Code\dotnet-sdk\artifacts\tasks\obj\toolset-tasks\Debug\net8.0\toolset-tasks.dll" to "E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll". Beginning retry 1 in 1000ms. The process cannot access the file 'E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll' because it is being used by another process. The file is locked by: ".NET Host (19284)" [E:\Code\dotnet-sdk\src\Layout\toolset-tasks\toolset-tasks.csproj]
    C:\Program Files\dotnet\sdk\9.0.100-alpha.1.24067.4\Microsoft.Common.CurrentVersion.targets(4787,5): warning MSB3026: Could not copy "E:\Code\dotnet-sdk\artifacts\tasks\obj\toolset-tasks\Debug\net8.0\toolset-tasks.dll" to "E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll". Beginning retry 2 in 1000ms. The process cannot access the file 'E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll' because it is being used by another process. The file is locked by: ".NET Host (19284)" [E:\Code\dotnet-sdk\src\Layout\toolset-tasks\toolset-tasks.csproj]
    C:\Program Files\dotnet\sdk\9.0.100-alpha.1.24067.4\Microsoft.Common.CurrentVersion.targets(4787,5): warning MSB3026: Could not copy "E:\Code\dotnet-sdk\artifacts\tasks\obj\toolset-tasks\Debug\net8.0\toolset-tasks.dll" to "E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll". Beginning retry 3 in 1000ms. The process cannot access the file 'E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll' because it is being used by another process. The file is locked by: ".NET Host (19284)" [E:\Code\dotnet-sdk\src\Layout\toolset-tasks\toolset-tasks.csproj]
    C:\Program Files\dotnet\sdk\9.0.100-alpha.1.24067.4\Microsoft.Common.CurrentVersion.targets(4787,5): warning MSB3026: Could not copy "E:\Code\dotnet-sdk\artifacts\tasks\obj\toolset-tasks\Debug\net8.0\toolset-tasks.dll" to "E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll". Beginning retry 4 in 1000ms. The process cannot access the file 'E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll' because it is being used by another process. The file is locked by: ".NET Host (19284)" [E:\Code\dotnet-sdk\src\Layout\toolset-tasks\toolset-tasks.csproj]
    C:\Program Files\dotnet\sdk\9.0.100-alpha.1.24067.4\Microsoft.Common.CurrentVersion.targets(4787,5): warning MSB3026: Could not copy "E:\Code\dotnet-sdk\artifacts\tasks\obj\toolset-tasks\Debug\net8.0\toolset-tasks.dll" to "E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll". Beginning retry 5 in 1000ms. The process cannot access the file 'E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll' because it is being used by another process. The file is locked by: ".NET Host (19284)" [E:\Code\dotnet-sdk\src\Layout\toolset-tasks\toolset-tasks.csproj]
    C:\Program Files\dotnet\sdk\9.0.100-alpha.1.24067.4\Microsoft.Common.CurrentVersion.targets(4787,5): warning MSB3026: Could not copy "E:\Code\dotnet-sdk\artifacts\tasks\obj\toolset-tasks\Debug\net8.0\toolset-tasks.dll" to "E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll". Beginning retry 6 in 1000ms. The process cannot access the file 'E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll' because it is being used by another process. The file is locked by: ".NET Host (19284)" [E:\Code\dotnet-sdk\src\Layout\toolset-tasks\toolset-tasks.csproj]
    C:\Program Files\dotnet\sdk\9.0.100-alpha.1.24067.4\Microsoft.Common.CurrentVersion.targets(4787,5): warning MSB3026: Could not copy "E:\Code\dotnet-sdk\artifacts\tasks\obj\toolset-tasks\Debug\net8.0\toolset-tasks.dll" to "E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll". Beginning retry 7 in 1000ms. The process cannot access the file 'E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll' because it is being used by another process. The file is locked by: ".NET Host (19284)" [E:\Code\dotnet-sdk\src\Layout\toolset-tasks\toolset-tasks.csproj]
    C:\Program Files\dotnet\sdk\9.0.100-alpha.1.24067.4\Microsoft.Common.CurrentVersion.targets(4787,5): warning MSB3026: Could not copy "E:\Code\dotnet-sdk\artifacts\tasks\obj\toolset-tasks\Debug\net8.0\toolset-tasks.dll" to "E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll". Beginning retry 8 in 1000ms. The process cannot access the file 'E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll' because it is being used by another process. The file is locked by: ".NET Host (19284)" [E:\Code\dotnet-sdk\src\Layout\toolset-tasks\toolset-tasks.csproj]
    C:\Program Files\dotnet\sdk\9.0.100-alpha.1.24067.4\Microsoft.Common.CurrentVersion.targets(4787,5): warning MSB3026: Could not copy "E:\Code\dotnet-sdk\artifacts\tasks\obj\toolset-tasks\Debug\net8.0\toolset-tasks.dll" to "E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll". Beginning retry 9 in 1000ms. The process cannot access the file 'E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll' because it is being used by another process. The file is locked by: ".NET Host (19284)" [E:\Code\dotnet-sdk\src\Layout\toolset-tasks\toolset-tasks.csproj]
    C:\Program Files\dotnet\sdk\9.0.100-alpha.1.24067.4\Microsoft.Common.CurrentVersion.targets(4787,5): warning MSB3026: Could not copy "E:\Code\dotnet-sdk\artifacts\tasks\obj\toolset-tasks\Debug\net8.0\toolset-tasks.dll" to "E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll". Beginning retry 10 in 1000ms. The process cannot access the file 'E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll' because it is being used by another process. The file is locked by: ".NET Host (19284)" [E:\Code\dotnet-sdk\src\Layout\toolset-tasks\toolset-tasks.csproj]
    C:\Program Files\dotnet\sdk\9.0.100-alpha.1.24067.4\Microsoft.Common.CurrentVersion.targets(4787,5): error MSB3027: Could not copy "E:\Code\dotnet-sdk\artifacts\tasks\obj\toolset-tasks\Debug\net8.0\toolset-tasks.dll" to "E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll". Exceeded retry count of 10. Failed. The file is locked by: ".NET Host (19284)" [E:\Code\dotnet-sdk\src\Layout\toolset-tasks\toolset-tasks.csproj]
    C:\Program Files\dotnet\sdk\9.0.100-alpha.1.24067.4\Microsoft.Common.CurrentVersion.targets(4787,5): error MSB3021: Unable to copy file "E:\Code\dotnet-sdk\artifacts\tasks\obj\toolset-tasks\Debug\net8.0\toolset-tasks.dll" to "E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll". The process cannot access the file 'E:\Code\dotnet-sdk\artifacts\tasks\bin\toolset-tasks\Debug\net8.0\toolset-tasks.dll' because it is being used by another process. [E:\Code\dotnet-sdk\src\Layout\toolset-tasks\toolset-tasks.csproj]

Build failed with errors in 15.8s

What's especially gross here is that each copy error is repeated - in the TL display that's double bad because we never saw the copies in the first place.

Analysis

No response

Versions & Configurations

No response

@baronfel baronfel added bug needs-triage Have yet to determine what bucket this goes in. Area: Terminal Logger Problems with the livelogger/fancylogger/terminallogger -tl functionality. labels Jan 17, 2024
@AR-May AR-May added triaged Priority:2 Work that is important, but not critical for the release and removed needs-triage Have yet to determine what bucket this goes in. labels Jan 23, 2024
@baronfel
Copy link
Member Author

This could potentially be resolved by making the Copy Task use whatever progress-reporting or ephemeral message APIs we create.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Terminal Logger Problems with the livelogger/fancylogger/terminallogger -tl functionality. bug Priority:2 Work that is important, but not critical for the release triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants