Issue #237 - Improve diagnostics of the Runaway Process Killer when it kills the process (#239)

* Issue #237 - Improve diagnostics of the Runaway Process Killer when it kills the process

* Issue #237 - Also print the process (not sure if it's safe)
pull/252/head
Oleg Nenashev 2017-09-18 18:25:16 +02:00 committed by GitHub
parent 221d30f271
commit 8d94277288
1 changed files with 13 additions and 1 deletions

View File

@ -6,6 +6,7 @@ using winsw.Extensions;
using winsw.Util;
using log4net;
using System.Collections.Specialized;
using System.Text;
namespace winsw.Plugins.RunawayProcessKiller
{
@ -151,7 +152,18 @@ namespace winsw.Plugins.RunawayProcessKiller
}
// Kill the runaway process
Logger.Warn("Stopping the runaway process (pid=" + pid + ") and its children.");
StringBuilder bldr = new StringBuilder("Stopping the runaway process (pid=");
bldr.Append(pid);
bldr.Append(") and its children. Environment was ");
if (!CheckWinSWEnvironmentVariable) {
bldr.Append("not ");
}
bldr.Append("checked, affiliated service ID: ");
bldr.Append(affiliatedServiceId != null ? affiliatedServiceId : "undefined");
bldr.Append(", process to kill: ");
bldr.Append(proc);
Logger.Warn(bldr.ToString());
ProcessHelper.StopProcessAndChildren(pid, this.StopTimeout, this.StopParentProcessFirst);
}