@Override
  public void abortFragmentInstance(FragmentInstanceId instanceId, Throwable t) {
    Map<FragmentInstanceId, Set<DriverTask>> queryRelatedTasks =
        queryMap.get(instanceId.getQueryId());
    if (queryRelatedTasks != null) {
      Set<DriverTask> instanceRelatedTasks = queryRelatedTasks.remove(instanceId);
      if (instanceRelatedTasks != null) {
        synchronized (instanceRelatedTasks) {
          for (DriverTask task : instanceRelatedTasks) {
            if (task == null) {
              return;
            }
            task.setAbortCause(
                t == null
                    ? new DriverTaskAbortedException(
                        task.getDriverTaskId().getFullId(),
                        DriverTaskAbortedException.BY_FRAGMENT_ABORT_CALLED)
                    : t);
            clearDriverTask(task);
          }
        }
      }
    }
  }
The manager of fragment instances scheduling.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/schedule/DriverScheduler.java