public void run() { try { c.connect(true).get(); if (c.isOnline()) { LOGGER.log(INFO, "Launched computer {0} per schedule", new Object[]{c.getName()}); } if (keepUpWhenActive && c.isOnline() && !c.isAcceptingTasks()) { LOGGER.log(INFO, "Enabling new jobs for computer {0} as it has started its scheduled uptime", new Object[]{c.getName()}); c.setAcceptingTasks(true); } } catch (InterruptedException | ExecutionException e) { } } });
boolean shouldBeOnline = isOnlineScheduled(); LOGGER.log(Level.FINE, "Checking computer {0} against schedule. online = {1}, shouldBeOnline = {2}", new Object[]{c.getName(), c.isOnline(), shouldBeOnline}); if (shouldBeOnline && c.isOffline()) { LOGGER.log(INFO, "Trying to launch computer {0} as schedule says it should be on-line at " } else if (!shouldBeOnline && c.isOnline()) { if (keepUpWhenActive) { if (!c.isIdle() && c.isAcceptingTasks()) {
@Override protected void performExecute() throws TaskException { final SlaveComputer computer = slave.getComputer(); if (computer == null) { LOGGER.warning("Computer is null for the slave: " + slave); return; } this.result = computer.isOnline(); LOGGER.config("Jenkins slave is online: " + this.result); }
@Override public void launch(@Nonnull SlaveComputer computer, TaskListener listener) throws IOException, InterruptedException { Slave n = computer.getNode(); if (!(n instanceof JCloudsSlave)) { LOGGER.warning(getClass().getSimpleName() + " used to launch incompatible computer type " + computer.getClass()); return; } JCloudsSlave node = (JCloudsSlave) n; Integer configuredTimeout = node.getSlaveOptions().getStartTimeout(); if (configuredTimeout == null) throw new NullPointerException(); long timeout = node.getCreatedTime() + configuredTimeout; do { launcher(computer).launch(computer, listener); if (computer.isOnline()) return; listener.getLogger().println("Launcher failed to bring the node online. Retrying ..."); Thread.sleep(2000); } while (System.currentTimeMillis() < timeout); listener.getLogger().println("Launcher failed to bring the node online within timeout."); }
public void run() { try { c.connect(true).get(); if (c.isOnline()) { LOGGER.log(INFO, "Launched computer {0} per schedule", new Object[]{c.getName()}); } if (keepUpWhenActive && c.isOnline() && !c.isAcceptingTasks()) { LOGGER.log(INFO, "Enabling new jobs for computer {0} as it has started its scheduled uptime", new Object[]{c.getName()}); c.setAcceptingTasks(true); } } catch (InterruptedException | ExecutionException e) { } } });
public void run() { try { c.connect(true).get(); if (c.isOnline()) { LOGGER.log(INFO, "Launched computer {0} per schedule", new Object[]{c.getName()}); } if (keepUpWhenActive && c.isOnline() && !c.isAcceptingTasks()) { LOGGER.log(INFO, "Enabling new jobs for computer {0} as it has started its scheduled uptime", new Object[]{c.getName()}); c.setAcceptingTasks(true); } } catch (InterruptedException e) { } catch (ExecutionException e) { } } });
public void run() { try { c.connect(true).get(); if (c.isOnline()) { LOGGER.log(INFO, "Launched computer {0} per schedule", new Object[]{c.getName()}); } if (keepUpWhenActive && c.isOnline() && !c.isAcceptingTasks()) { LOGGER.log(INFO, "Enabling new jobs for computer {0} as it has started its scheduled uptime", new Object[]{c.getName()}); c.setAcceptingTasks(true); } } catch (InterruptedException e) { } catch (ExecutionException e) { } } });
public void run() { try { c.connect(true).get(); if (c.isOnline()) { LOGGER.log(INFO, "Launched computer {0} per schedule", new Object[]{c.getName()}); } if (keepUpWhenActive && c.isOnline() && !c.isAcceptingTasks()) { LOGGER.log(INFO, "Enabling new jobs for computer {0} as it has started its scheduled uptime", new Object[]{c.getName()}); c.setAcceptingTasks(true); } } catch (InterruptedException e) { } catch (ExecutionException e) { } } });
public void run() { try { c.connect(true).get(); if (c.isOnline()) { LOGGER.log(INFO, "Launched computer {0} per schedule", new Object[]{c.getName()}); } if (keepUpWhenActive && c.isOnline() && !c.isAcceptingTasks()) { LOGGER.log(INFO, "Enabling new jobs for computer {0} as it has started its scheduled uptime", new Object[]{c.getName()}); c.setAcceptingTasks(true); } } catch (InterruptedException e) { } catch (ExecutionException e) { } } });
/** * @param computer {@link hudson.model.Computer} for which agent should be launched * @param listener The progress of the launch, as well as any error, should be sent to this listener. * @return true, if successfully launched, otherwise false */ protected boolean delegateLaunch(SlaveComputer computer, TaskListener listener) { try { log(listener, "Starting stage 2 launcher (" + delegate.getClass().getSimpleName() + ")"); getCore().launch(computer, listener); log(listener, "Stage 2 launcher completed"); return computer.isOnline(); } catch (IOException e) { log(listener, "Unable to launch: " + e.getMessage()); return false; } catch (InterruptedException e) { log(listener, "Unable to launch: " + e.getMessage()); return false; } }
boolean shouldBeOnline = isOnlineScheduled(); LOGGER.log(Level.FINE, "Checking computer {0} against schedule. online = {1}, shouldBeOnline = {2}", new Object[]{c.getName(), c.isOnline(), shouldBeOnline}); if (shouldBeOnline && c.isOffline()) { LOGGER.log(INFO, "Trying to launch computer {0} as schedule says it should be on-line at " } else if (!shouldBeOnline && c.isOnline()) { if (keepUpWhenActive) { if (!c.isIdle() && c.isAcceptingTasks()) {
@Override public Node call() throws AzureCloudException { synchronized (agentNode) { if (agentNode.getComputer().isOnline()) { return agentNode;
public synchronized long check(final SlaveComputer c) { boolean shouldBeOnline = isOnlineScheduled(); LOGGER.log(Level.FINE, "Checking computer {0} against schedule. online = {1}, shouldBeOnline = {2}", new Object[]{c.getName(), c.isOnline(), shouldBeOnline}); if (shouldBeOnline && c.isOffline()) { LOGGER.log(INFO, "Trying to launch computer {0} as schedule says it should be on-line at " } else if (!shouldBeOnline && c.isOnline()) { if (keepUpWhenActive) { if (!c.isIdle() && c.isAcceptingTasks()) {
public synchronized long check(final SlaveComputer c) { boolean shouldBeOnline = isOnlineScheduled(); LOGGER.log(Level.FINE, "Checking computer {0} against schedule. online = {1}, shouldBeOnline = {2}", new Object[]{c.getName(), c.isOnline(), shouldBeOnline}); if (shouldBeOnline && c.isOffline()) { LOGGER.log(INFO, "Trying to launch computer {0} as schedule says it should be on-line at " } else if (!shouldBeOnline && c.isOnline()) { if (keepUpWhenActive) { if (!c.isIdle() && c.isAcceptingTasks()) {
public synchronized long check(final SlaveComputer c) { boolean shouldBeOnline = isOnlineScheduled(); LOGGER.log(Level.FINE, "Checking computer {0} against schedule. online = {1}, shouldBeOnline = {2}", new Object[]{c.getName(), c.isOnline(), shouldBeOnline}); if (shouldBeOnline && c.isOffline()) { LOGGER.log(INFO, "Trying to launch computer {0} as schedule says it should be on-line at " } else if (!shouldBeOnline && c.isOnline()) { if (keepUpWhenActive) { if (!c.isIdle() && c.isAcceptingTasks()) {
public synchronized long check(final SlaveComputer c) { boolean shouldBeOnline = isOnlineScheduled(); LOGGER.log(Level.FINE, "Checking computer {0} against schedule. online = {1}, shouldBeOnline = {2}", new Object[]{c.getName(), c.isOnline(), shouldBeOnline}); if (shouldBeOnline && c.isOffline()) { LOGGER.log(INFO, "Trying to launch computer {0} as schedule says it should be on-line at " } else if (!shouldBeOnline && c.isOnline()) { if (keepUpWhenActive) { if (!c.isIdle() && c.isAcceptingTasks()) {