Skip to content

Commit

Permalink
Add logging of service process details on timeout (#4253)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotas authored Oct 31, 2019
1 parent 062cf50 commit 3bbaf86
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,26 @@ private void Dispose(bool disposing)
{
foreach (Process p in Process.GetProcesses())
{
description.AppendLine($"Process: {p.ProcessName} PrivateMemory: {p.PrivateMemorySize64}");
description.AppendLine($"Process: {p.Id} {p.ProcessName} PrivateMemory: {p.PrivateMemorySize64}");
}
}

try
{
Process p = Process.Start(new ProcessStartInfo()
{
FileName = "tasklist.exe",
Arguments = "/svc /fi \"imagename eq svchost.exe\"",
UseShellExecute = false,
RedirectStandardOutput = true,
}
);

description.Append(p.StandardOutput.ReadToEnd());
}
catch
{
}
}

if (!Process.WaitForExit(halfTimeOut))
Expand Down

0 comments on commit 3bbaf86

Please sign in to comment.