private void finish() {
    LOG.debug("finished at ", System.currentTimeMillis());
    synchronized (files) {
      session = null;
    }
    if (launched.getAndSet(false)) {
      launch();
    }
    else if (scheduled.getAndSet(false) || !paused.get()) {
      schedule();
    }
  }
private void finish()