Skip to content

Commit

Permalink
Issue winsw#237 - Improve diagnostics of the Runaway Process Killer w…
Browse files Browse the repository at this point in the history
…hen it kills the process (winsw#239)

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

* Issue winsw#237 - Also print the process (not sure if it's safe)
  • Loading branch information
oleg-nenashev authored Sep 18, 2017
1 parent 221d30f commit 8d94277
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using winsw.Util;
using log4net;
using System.Collections.Specialized;
using System.Text;

namespace winsw.Plugins.RunawayProcessKiller
{
Expand Down Expand Up @@ -151,7 +152,18 @@ public override void OnWrapperStarted()
}

// 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);
}

Expand Down

0 comments on commit 8d94277

Please sign in to comment.