@Override public ExecResponse doCall() { try { return future().get(timeouts.scriptComplete, TimeUnit.MILLISECONDS); } catch (Throwable e) { eventBus.post(new StatementOnNodeFailure(init, node, e)); throw Throwables.propagate(e); } }
@Subscribe @AllowConcurrentEvents public void onFailure(StatementOnNodeFailure event) { LOG.error("<< error running {} on node({}): {}", new Object[] { event.getStatement(), event.getNode().getId(), event.getCause().getMessage() }, event.getCause()); }
@Override public ExecResponse doCall() { try { return future().get(timeouts.scriptComplete, TimeUnit.MILLISECONDS); } catch (Throwable e) { eventBus.post(new StatementOnNodeFailure(init, node, e)); throw Throwables.propagate(e); } }
@Subscribe @AllowConcurrentEvents public void onFailure(StatementOnNodeFailure event) { LOG.error("<< error running {} on node({}): {}", new Object[] { event.getStatement(), event.getNode().getId(), event.getCause().getMessage() }, event.getCause()); }
@Override public ExecResponse doCall() { try { return future().get(timeouts.scriptComplete, TimeUnit.MILLISECONDS); } catch (Throwable e) { eventBus.post(new StatementOnNodeFailure(init, node, e)); throw Throwables.propagate(e); } }
@Subscribe @AllowConcurrentEvents public void onFailure(StatementOnNodeFailure event) { logger.error("<< error running {} on node({}): {}", new Object[] { event.getStatement(), event.getNode().getId(), event.getCause().getMessage() }, event.getCause()); }
@Override public ExecResponse doCall() { try { return future().get(timeouts.scriptComplete, TimeUnit.MILLISECONDS); } catch (Throwable e) { eventBus.post(new StatementOnNodeFailure(init, node, e)); throw Throwables.propagate(e); } }
public BlockUntilInitScriptStatusIsZeroThenReturnOutput future() { ExecResponse returnVal = super.doCall(); if (returnVal.getExitStatus() != 0) { IllegalStateException e = new IllegalStateException(String.format( "instance: %s on node: %s had non-zero exit status: %s", init.getInstanceName(), getNode().getId(), returnVal)); eventBus.post(new StatementOnNodeFailure(init, node, e)); throw e; } return statusFactory.create(this).init(); }
public BlockUntilInitScriptStatusIsZeroThenReturnOutput future() { ExecResponse returnVal = super.doCall(); if (returnVal.getExitStatus() != 0) { IllegalStateException e = new IllegalStateException(String.format( "instance: %s on node: %s had non-zero exit status: %s", init.getInstanceName(), getNode().getId(), returnVal)); eventBus.post(new StatementOnNodeFailure(init, node, e)); throw e; } return statusFactory.create(this).init(); }
public BlockUntilInitScriptStatusIsZeroThenReturnOutput future() { ExecResponse returnVal = super.doCall(); if (returnVal.getExitStatus() != 0) { IllegalStateException e = new IllegalStateException(String.format( "instance: %s on node: %s had non-zero exit status: %s", init.getInstanceName(), getNode().getId(), returnVal)); eventBus.post(new StatementOnNodeFailure(init, node, e)); throw e; } return statusFactory.create(this).init(); }
public BlockUntilInitScriptStatusIsZeroThenReturnOutput future() { ExecResponse returnVal = super.doCall(); if (returnVal.getExitStatus() != 0) { IllegalStateException e = new IllegalStateException(String.format( "instance: %s on node: %s had non-zero exit status: %s", init.getInstanceName(), getNode().getId(), returnVal)); eventBus.post(new StatementOnNodeFailure(init, node, e)); throw e; } return statusFactory.create(this).init(); }
@Override protected void interruptTask() { logger.debug("<< cancelled(%s)", commandRunner.getStatement().getInstanceName()); ExecResponse returnVal = commandRunner.refreshAndRunAction("stop"); CancellationException e = new CancellationException(String.format( "cancelled %s on node: %s; stop command had exit status: %s", getCommandRunner().getStatement() .getInstanceName(), getCommandRunner().getNode().getId(), returnVal)); eventBus.post(new StatementOnNodeFailure(getCommandRunner().getStatement(), getCommandRunner().getNode(), e)); super.interruptTask(); }
@Override public ExecResponse call() { checkState(ssh != null, "please call init() before invoking call"); try { ssh.connect(); ExecResponse returnVal; eventBus.post(new StatementOnNodeSubmission(statement, node)); String command = runAsRoot ? execAsRoot(statement.render(OsFamily.UNIX)) : execScriptAsDefaultUser(statement .render(OsFamily.UNIX)); try { returnVal = runCommand(command); } catch (Throwable e) { eventBus.post(new StatementOnNodeFailure(statement, node, e)); throw Throwables.propagate(e); } eventBus.post(new StatementOnNodeCompletion(statement, node, returnVal)); if (logger.isTraceEnabled()) logger.trace("<< %s[%s]", statement, returnVal); else logger.debug("<< %s(%d)", statement, returnVal.getExitStatus()); return returnVal; } finally { if (ssh != null) ssh.disconnect(); } }
@Override protected void interruptTask() { logger.debug("<< cancelled(%s)", commandRunner.getStatement().getInstanceName()); ExecResponse returnVal = commandRunner.refreshAndRunAction("stop"); CancellationException e = new CancellationException(String.format( "cancelled %s on node: %s; stop command had exit status: %s", getCommandRunner().getStatement() .getInstanceName(), getCommandRunner().getNode().getId(), returnVal)); eventBus.post(new StatementOnNodeFailure(getCommandRunner().getStatement(), getCommandRunner().getNode(), e)); super.interruptTask(); }
@Override public ExecResponse call() { checkState(ssh != null, "please call init() before invoking call"); try { ssh.connect(); ExecResponse returnVal; eventBus.post(new StatementOnNodeSubmission(statement, node)); String command = runAsRoot ? execAsRoot(statement.render(OsFamily.UNIX)) : execScriptAsDefaultUser(statement .render(OsFamily.UNIX)); try { returnVal = runCommand(command); } catch (Throwable e) { eventBus.post(new StatementOnNodeFailure(statement, node, e)); throw Throwables.propagate(e); } eventBus.post(new StatementOnNodeCompletion(statement, node, returnVal)); if (logger.isTraceEnabled()) logger.trace("<< %s[%s]", statement, returnVal); else logger.debug("<< %s(%d)", statement, returnVal.getExitStatus()); return returnVal; } finally { if (ssh != null) ssh.disconnect(); } }
@Override public ExecResponse call() { checkState(ssh != null, "please call init() before invoking call"); try { ssh.connect(); ExecResponse returnVal; eventBus.post(new StatementOnNodeSubmission(statement, node)); String command = runAsRoot ? execAsRoot(statement.render(OsFamily.UNIX)) : execScriptAsDefaultUser(statement .render(OsFamily.UNIX)); try { returnVal = runCommand(command); } catch (Throwable e) { eventBus.post(new StatementOnNodeFailure(statement, node, e)); throw Throwables.propagate(e); } eventBus.post(new StatementOnNodeCompletion(statement, node, returnVal)); if (logger.isTraceEnabled()) logger.trace("<< %s[%s]", statement, returnVal); else logger.debug("<< %s(%d)", statement, returnVal.getExitStatus()); return returnVal; } finally { if (ssh != null) ssh.disconnect(); } }
@Override protected void interruptTask() { logger.debug("<< cancelled(%s)", commandRunner.getStatement().getInstanceName()); ExecResponse returnVal = commandRunner.refreshAndRunAction("stop"); CancellationException e = new CancellationException(String.format( "cancelled %s on node: %s; stop command had exit status: %s", getCommandRunner().getStatement() .getInstanceName(), getCommandRunner().getNode().getId(), returnVal)); eventBus.post(new StatementOnNodeFailure(getCommandRunner().getStatement(), getCommandRunner().getNode(), e)); super.interruptTask(); }
@Override public ExecResponse call() { checkState(ssh != null, "please call init() before invoking call"); try { ssh.connect(); ExecResponse returnVal; eventBus.post(new StatementOnNodeSubmission(statement, node)); String command = runAsRoot ? execAsRoot(statement.render(OsFamily.UNIX)) : execScriptAsDefaultUser(statement .render(OsFamily.UNIX)); try { returnVal = runCommand(command); } catch (Throwable e) { eventBus.post(new StatementOnNodeFailure(statement, node, e)); throw Throwables.propagate(e); } eventBus.post(new StatementOnNodeCompletion(statement, node, returnVal)); if (logger.isTraceEnabled()) logger.trace("<< %s[%s]", statement, returnVal); else logger.debug("<< %s(%d)", statement, returnVal.getExitStatus()); return returnVal; } finally { if (ssh != null) ssh.disconnect(); } }
@Override protected void interruptTask() { logger.debug("<< cancelled(%s)", commandRunner.getStatement().getInstanceName()); ExecResponse returnVal = commandRunner.refreshAndRunAction("stop"); CancellationException e = new CancellationException(String.format( "cancelled %s on node: %s; stop command had exit status: %s", getCommandRunner().getStatement() .getInstanceName(), getCommandRunner().getNode().getId(), returnVal)); eventBus.post(new StatementOnNodeFailure(getCommandRunner().getStatement(), getCommandRunner().getNode(), e)); super.interruptTask(); }
return runAction("start"); } catch (Throwable e) { eventBus.post(new StatementOnNodeFailure(init, node, e)); throw Throwables.propagate(e);