-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
MSBuild task hangs occasionally in Linux when invoking 'dotnet run' #9671
Comments
Can you capture a dump when this happens? Do you see the dotnet run process running without stopping when this happens. |
I only had bash, and three dotnet processes. I don't have a The dotnet processes were all sleeping, as if they were waiting for something. Also, IIRC, the processes were grand parent, parent and child. I believe The project I run is just a simple console app that don't read from stdin, it only grabs some CLR metadata that it writes to a file. I did try to do a |
I just tried to reproduce the error in my own docker host, but I cannot reproduce the hanging |
We have the same problem. We noticed that the task actually completes successfully after 15 minutes. The DefaultNodeConnectionTimeout is 900 seconds -- possibly related? |
@ladipro /@rainersigwald is there any debugging information in MSBuild that could help diagnose if this is a node connection issue? |
Setting |
@MartinKarlgrenIMI, with |
@ladipro, sure, files below. MSBuild_CommTrace_PID_1794.txt |
It looks like |
Likely the same root cause as dotnet/sdk#9452. Could be specific to AzDO environment. |
@MartinKarlgrenIMI can you please try passing the |
@ladipro unfortunately |
@SeijiSuenaga my understanding is that |
@ladipro Ah, sorry. Just tried that as well, but it still hung for 15 minutes. (In my case, the hangs are happening in GitLab CI, so I tested it by enabling their That said, I did find a workaround for my particular scenario. In case it helps anyone else, I found that my MSBuild target was only hanging when executing as part of |
Steps to reproduce
Create a project, add a target that is invoked before target
BeforeBuild
. That task should then invoke<Exec Command="dotnet run -c $(Configuration) -p ../OtherProject" />
.Expected behavior
I expect the command to run and finish, so that msbuild can continue executing targets.
Actual behavior
Msbuild seemingly hangs, as if it cannot determine that
OtherProject
has exited. This only occurs in Linux, and only sometimes. It always hangs when I run the same task on the Ubuntu 1604 hosted agent in Azure DevOps. It sometimes hangs when I run the same task in Docker on my Windows desktop machine.Environment data
I am using the docker image
microsoft/dotnet:2.2-sdk
as a base for my own image. I have stripped it down to a bare minimum with/bin/bash
as ENTRYPOINT, so that I have been able to run the commands manually.dotnet --info
output:The "offending" target looks like this in my .csproj:
The project
Tracy.Core.Dal.ModelBuilderGenerator
is a custom project that generates code at runtime for other projects to consume. In the logs I can see all the output from the generator project. The very last output is right beforereturn 0;
.The workaround I have now is to tag the target with
Condition="'$(BuildingInsideVisualStudio)' == 'true'"
so that it'll work as expected during development time. During build, I publish the tool in my Docker file to an executable, which I run before the initialdotnet
invocation.Source code access
Access to source code etc can be arranged privately if needed.
The text was updated successfully, but these errors were encountered: