@Override public void run() { if (c.isIdle()) { LOGGER.log(INFO, "Disconnecting computer {0} as it has finished its scheduled uptime", new Object[]{c.getName()}); c.disconnect(OfflineCause .create(Messages._SimpleScheduledRetentionStrategy_FinishedUpTime())); } else { c.setAcceptingTasks(false); } } });
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) { } } });
if (keepUpWhenActive) { if (!c.isIdle() && c.isAcceptingTasks()) { c.setAcceptingTasks(false); LOGGER.log(INFO, "Disabling new jobs for computer {0} as it has finished its scheduled uptime",
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) { } } });
@Override public void run() { if (c.isIdle()) { LOGGER.log(INFO, "Disconnecting computer {0} as it has finished its scheduled uptime", new Object[]{c.getName()}); c.disconnect(OfflineCause .create(Messages._SimpleScheduledRetentionStrategy_FinishedUpTime())); } else { c.setAcceptingTasks(false); } } });
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) { } } });
public synchronized void shutdown(Localizable reason) { if (isEligibleForReuse()) { LOGGER.log(Level.INFO, "AzureVMAgent: shutdown: agent {0} is always shut down", this. getDisplayName()); return; } LOGGER.log(Level.INFO, "AzureVMAgent: shutdown: Add suspended status for node {0}", this.getNodeName()); this.getComputer().setAcceptingTasks(false); this.getComputer().disconnect(OfflineCause.create(reason)); LOGGER.log(Level.INFO, "AzureVMAgent: shutdown: shutting down agent {0}", this. getDisplayName()); AzureVMManagementServiceDelegate serviceDelegate = getServiceDelegate(); if (serviceDelegate != null) { serviceDelegate.shutdownVirtualMachine(this); } // After shutting down successfully, set the node as eligible for // reuse. setEligibleForReuse(true); final Map<String, String> properties = new HashMap<>(); properties.put("Reason", reason == null ? "Unknown reason" : reason.toString()); AzureVMAgentPlugin.sendEvent(Constants.AI_VM_AGENT, "ShutDown", properties); }
computer.setAcceptingTasks(false); computer.setAcceptingTasks(true); return; computer.setAcceptingTasks(true);
c.setAcceptingTasks(false); try { if (isIdleForTooLong(c)) { c.setAcceptingTasks(shouldAcceptTasks);
computer.setAcceptingTasks(false); KubernetesSlave slave = kubernetesComputer.getNode(); if (slave == null) { computer.setAcceptingTasks(true); return; computer.setAcceptingTasks(true); } catch (Throwable ex) { LOGGER.log(Level.WARNING, String.format("Error in provisioning; agent=%s, template=%s", slave, unwrappedTemplate), ex);
agent.getComputer().setAcceptingTasks(false); agent.setCleanUpAction(CleanUpAction.DELETE, Messages._Agent_Failed_To_Connect()); return; cleanUpReason = Messages._Agent_Failed_To_Connect(); agent.getComputer().setAcceptingTasks(false);
/** * Delete node in Azure and in Jenkins. * * @throws Exception On error */ public synchronized void deprovision(Localizable reason) throws Exception { if (Jenkins.getInstance().getNode(this.name) == null || this.getComputer() == null) { return; } LOGGER.log(Level.INFO, "AzureVMAgent: deprovision: Deprovision called for agent {0}, for reason: {1}", new Object[]{this.getDisplayName(), reason == null ? "Unknown reason" : reason.toString()}); this.getComputer().setAcceptingTasks(false); this.getComputer().disconnect(OfflineCause.create(reason)); AzureVMManagementServiceDelegate.terminateVirtualMachine(this); LOGGER.log(Level.INFO, "AzureVMAgent: deprovision: {0} has been deprovisioned. Remove node ...", this.getDisplayName()); // Adjust estimated virtual machine count. AzureVMCloud parentCloud = getCloud(); if (parentCloud != null) { parentCloud.adjustVirtualMachineCount(-1); } Jenkins.getInstance().removeNode(this); final Map<String, String> properties = new HashMap<>(); properties.put("Reason", reason == null ? "Unknown reason" : reason.toString()); AzureVMAgentPlugin.sendEvent(Constants.AI_VM_AGENT, "Deprovision", properties); }
if (keepUpWhenActive) { if (!c.isIdle() && c.isAcceptingTasks()) { c.setAcceptingTasks(false); LOGGER.log(INFO, "Disabling new jobs for computer {0} as it has finished its scheduled uptime",
if (keepUpWhenActive) { if (!c.isIdle() && c.isAcceptingTasks()) { c.setAcceptingTasks(false); LOGGER.log(INFO, "Disabling new jobs for computer {0} as it has finished its scheduled uptime",
if (keepUpWhenActive) { if (!c.isIdle() && c.isAcceptingTasks()) { c.setAcceptingTasks(false); LOGGER.log(INFO, "Disabling new jobs for computer {0} as it has finished its scheduled uptime",
if (keepUpWhenActive) { if (!c.isIdle() && c.isAcceptingTasks()) { c.setAcceptingTasks(false); LOGGER.log(INFO, "Disabling new jobs for computer {0} as it has finished its scheduled uptime",
if (keepUpWhenActive) { if (!c.isIdle() && c.isAcceptingTasks()) { c.setAcceptingTasks(false); LOGGER.log(INFO, "Disabling new jobs for computer {0} as it has finished its scheduled uptime",