mirror of https://github.com/winsw/winsw
Do not propagate exceptions from Process.Kill() if the process actually exits (#166)
* Ignore more exceptions from Process.Kill() Sometimes we get an InvalidOperationException when we kill a process that is already dead and other times we get a Win32Exception. Let's ignore all exceptions from killing a process if it has exited. * Fix key name typo in README.md The name of the key has an underscore, not a hyphen.pull/167/head
parent
099c41f19d
commit
28917c44d6
|
@ -90,6 +90,6 @@ New versions with fixes may be released on-demand.
|
||||||
### Build Environment
|
### Build Environment
|
||||||
|
|
||||||
* IDE: [Visual Studio Community 2013](http://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx) (free for open-source projects)
|
* IDE: [Visual Studio Community 2013](http://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx) (free for open-source projects)
|
||||||
* `winsw-key.snk` should be available in the project's root in order to build the executable
|
* `winsw_key.snk` should be available in the project's root in order to build the executable
|
||||||
* You can generate the certificate in "Project Settings/Signing"
|
* You can generate the certificate in "Project Settings/Signing"
|
||||||
* The certificate is in <code>.gitignore</code> list. Please do not add it to the repository
|
* The certificate is in <code>.gitignore</code> list. Please do not add it to the repository
|
||||||
|
|
|
@ -66,9 +66,15 @@ namespace winsw.Util
|
||||||
Logger.Warn("SIGINT to " + pid + " failed - Killing as fallback");
|
Logger.Warn("SIGINT to " + pid + " failed - Killing as fallback");
|
||||||
proc.Kill();
|
proc.Kill();
|
||||||
}
|
}
|
||||||
catch (ArgumentException)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
if (!proc.HasExited)
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
// Process already exited.
|
// Process already exited.
|
||||||
|
Logger.Warn("Ignoring exception from killing process because it has exited", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue