You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// we will wait "forever" since that is the most safe action right not. We will leave it up to the setup code in the instances to make sure it won't run forever.
39
-
// If/when provide better UI experience we might revisit this and potentially find a way for the installer to control the timeout.
varp=Process.Start(processStartupInfo)??thrownewException($"Attempt to launch {exeName} failed.");
58
56
59
-
p.WaitForExit(timeout);
57
+
// Reading std err needs to happen before waiting to avoid the risk of a deadlock.
58
+
// See https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.standardoutput?view=net-9.0&redirectedfrom=MSDN#remarks for more details.
59
+
// Note that this will wait forever, should we want to avoid that the async ProcessStartInfo.ErrorDataReceived API needs to be used.
60
+
varerror=p.StandardError.ReadToEnd();
61
+
62
+
// we will wait "forever" since that is the most safe action right not. We will leave it up to the setup code in the instances to make sure it won't run forever.
63
+
// If/when provide better UI experience we might revisit this and potentially find a way for the installer to control the timeout.
64
+
p.WaitForExit();
60
65
61
66
if(!p.HasExited||p.ExitCode==0)
62
67
{
63
-
returnp;
68
+
return;
64
69
}
65
70
66
-
varerror=p.StandardError.ReadToEnd();
67
-
68
71
thrownewException($"{exeName} returned a non-zero exit code: {p.ExitCode}. This typically indicates a configuration error. The error output was:\r\n{error}");
0 commit comments