Hardcoded timeout limit for dotnet command leads to problems with debugging
See original GitHub issueSteps to reproduce:
- See that sometimes
cyclonedx-dotnet
returnsDotnet restore failed:
and so can’t make result bom file - In same case when run it pair with
dotnet restore
command everything is ok
Current result:
dotnet restore
is called inside cyclonedx-dotnet
in DotnetUtilsService.cs
public DotnetUtilsResult Restore(string path)
{
var arguments = "restore";
if (!string.IsNullOrEmpty(path)) arguments = $"{arguments} \"{path}\"";
var commandResult = _dotnetCommandService.Run(arguments);
if (commandResult.Success)
{
return new DotnetUtilsResult();
}
else
{
return new DotnetUtilsResult
{
// dotnet restore only outputs to std out, not std err
ErrorMessage = commandResult.StdOut
};
}
}
If look on dotnetCommandService.Run
public DotnetCommandResult Run(string workingDirectory, string arguments)
{
var psi = new ProcessStartInfo(DotNetExe.FullPathOrDefault(), arguments)
{
CreateNoWindow = true,
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
WorkingDirectory = workingDirectory
};
using (var p = Process.Start(psi))
{
var exitCode = 0;
// ...
var processExited = p.WaitForExit(60000);
if (processExited)
{
exitCode = p.ExitCode;
}
else
{
p.Kill();
exitCode = -1;
}
// ...
return result;
}
Here we see hard-limit for 60 sec to call dotnet restore
. It could be not enough in some cases, e.g. when you need to download 400+ heavyweight dependencies
Expected result:
- Add option for
cyclonedx-dotnet
to change this time limit - Add error message to output about the limit passing event
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Timeouts with deployed code but not during debugging
When you use debugging mode, request time out is infinite but that is not the case when you are running it through published...
Read more >Timeout While Debugging Web Services - Visual Studio ...
When you are stepping into an XML Web service from calling code, the call may sometimes time out, with the result being that...
Read more >The mystery of session timeout in ASP.NET Core 3.1 & 5
Now hit F5 (not Ctrl+F5) to launch the application in debugging mode. Everything should work as before but you will see lots of...
Read more >Worker Process startup timeout (30 sec) prevents reliably ...
When launching an azure function with func start --dotnet-isolated-debug , visual studio pauses for a period of time to allow you to attach ......
Read more >Debugging a native deadlock in a .NET Linux application
That's because the tool has a hardcoded 4 minutes timeout, and the symbol server is very slow when accessed outside of the United...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@oxdef closing this issue. It isn’t released yet. But will be in the next release.
@coderpatros Thanks for the quick fix!