Github user aledsage commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/145#discussion_r63859261
--- Diff:
software/base/src/main/java/org/apache/brooklyn/entity/software/base/VanillaWindowsProcessWinRmDriver.java
---
@@ -80,9 +84,22 @@ public void launch() {
@Override
public boolean isRunning() {
- int exitCode = executeCommandInTask(
-
getEntity().getConfig(VanillaWindowsProcess.CHECK_RUNNING_COMMAND),
-
getEntity().getConfig(VanillaWindowsProcess.CHECK_RUNNING_POWERSHELL_COMMAND),
"is-running-command");
+ int exitCode = 1;
+ try {
+ exitCode = executeCommandInTask(
+
getEntity().getConfig(VanillaWindowsProcess.CHECK_RUNNING_COMMAND),
+
getEntity().getConfig(VanillaWindowsProcess.CHECK_RUNNING_POWERSHELL_COMMAND),
"is-running-command");
+ } catch (Exception e) {
+ // If machine is restarting, then will get WinRM IOExceptions
- don't propagate such exceptions
+ Throwable interestingCause =
Exceptions.getFirstThrowableOfType(e, WebServiceException.class) != null ?
+ Exceptions.getFirstThrowableOfType(e,
WebServiceException.class/*Wraps Soap exceptions*/) :
Exceptions.getFirstThrowableOfType(e, Fault.class/*Wraps IO exceptions*/);
+ if (interestingCause != null) {
+ LOG.warn(getEntity() + " isRunning check failed. Executing
WinRM command failed.", e);
--- End diff --
I wonder how many times / how often we might get this exception logged if
the VM is rebooting for several minutes.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---