apache/hadoop · error · IllegalArgumentException

The child is already under another node:

Error message

The child is already under another node:

What it means

Error "The child is already under another node:" thrown in apache/hadoop.

Source

Thrown at hadoop-tools/hadoop-rumen/src/main/java/org/apache/hadoop/tools/rumen/Node.java:86

   */
  public int getLevel() {
    return level;
  }
  
  private void checkChildren() {
    if (children == null) {
      children = new TreeSet<Node>();
    }
  }

  /**
   * Add a child node to this node.
   * @param child The child node to be added. The child node should currently not be belong to another cluster topology.
   * @return Boolean indicating whether the node is successfully added.
   */
  public synchronized boolean addChild(Node child) {
    if (child.parent != null) {
      throw new IllegalArgumentException(
          "The child is already under another node:" + child.parent);
    }
    checkChildren();
    boolean retval = children.add(child);
    if (retval) child.parent = this;
    return retval;
  }

  /**
   * Does this node have any children?
   * @return Boolean indicate whether this node has any children.
   */
  public synchronized boolean hasChildren() {
    return children != null && !children.isEmpty();
  }

  /**
   * Get the children of this node.

View on GitHub (pinned to 2add963021)

Solutions

  1. Remove the node from its current parent before adding it under a new one.

When it happens

Trigger: A node that already has a parent in the Rumen topology tree is added under another node, which would corrupt the tree structure.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/e22cbde7d0514b82. Report an issue: GitHub.