persistNode(node); return true;
persistNode(node); } catch (IOException | RuntimeException e) {
persistNode(node); return true;
/** * Adds a node. If a node of the same name already exists then that node will be replaced. * * @param node the new node. * @throws IOException if the list of nodes could not be persisted. */ public void addNode(final @Nonnull Node node) throws IOException { if (node != nodes.get(node.getNodeName())) { // TODO we should not need to lock the queue for adding nodes but until we have a way to update the // computer list for just the new node Queue.withLock(new Runnable() { @Override public void run() { nodes.put(node.getNodeName(), node); jenkins.updateComputerList(); jenkins.trimLabels(); } }); // TODO there is a theoretical race whereby the node instance is updated/removed after lock release persistNode(node); NodeListener.fireOnCreated(node); } }