public void run()

in src/main/java/com/amazon/jenkins/ec2fleet/EC2FleetOnlineChecker.java [66:99]


    public void run() {
        if (future.isCancelled()) {
            return;
        }

        if (timeout < 1 || interval < 1) {
            future.set(node);
            LOGGER.log(Level.INFO, String.format("%s connection check disabled, resolve planned node", node.getNodeName()));
            return;
        }

        final Computer computer = node.toComputer();
        if (computer != null) {
            if (computer.isOnline()) {
                future.set(node);
                LOGGER.log(Level.INFO, String.format("%s connected, resolve planned node", node.getNodeName()));
                return;
            }
        }

        if (System.currentTimeMillis() - start > timeout) {
            future.setException(new IllegalStateException(
                    "Fail to provision node, cannot connect to " + node.getNodeName() + " in " + timeout + " msec"));
            return;
        }

        if (computer == null) {
            LOGGER.log(Level.INFO, String.format("%s no connection, wait before retry", node.getNodeName()));
        } else {
            computer.connect(false);
            LOGGER.log(Level.INFO, String.format("%s no connection, connect and wait before retry", node.getNodeName()));
        }
        EXECUTOR.schedule(this, interval, TimeUnit.MILLISECONDS);
    }