code: private boolean createAndStartSupervisorInternal(SupervisorSpec spec, boolean persistSpec)
    {
      String id = spec.getId();
      if (supervisors.containsKey(id)) {
        return false;
      }
  
      if (persistSpec) {
        metadataSupervisorManager.insert(id, spec);
      }
  
      Supervisor supervisor;
      try {
        supervisor = spec.createSupervisor();
        supervisor.start();
      }
      catch (Exception e) {
        // Supervisor creation or start failed write tombstone only when trying to start a new supervisor
        if (persistSpec) {
          metadataSupervisorManager.insert(id, new NoopSupervisorSpec(null, spec.getDataSources()));
        }
        throw new RuntimeException(e);
      }
  
      supervisors.put(id, Pair.of(supervisor, spec));
      return true;
    }
docs: Creates a supervisor from the provided spec and starts it if there is not already a supervisor with that id.
  <p/>
  Caller should have acquired [lock] before invoking this method to avoid contention with other threads that may be
  starting, stopping, suspending and resuming supervisors.
  
  @return true if a new supervisor was created, false if there was already an existing supervisor with this id