apache/hadoop · error

hdfsConnFree(username=%s): hdfsDisconnect failed with error

Error message

hdfsConnFree(username=%s): hdfsDisconnect failed with error %d

What it means

Error "hdfsConnFree(username=%s): hdfsDisconnect failed with error %d " thrown in apache/hadoop.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/fuse-dfs/fuse_connect.c:240

  exemplar.usrname = (char*)usrname;
  exemplar.kpath = (char*)kpath;
  return RB_FIND(hdfsConnTree, &gConnTree, &exemplar);
}

/**
 * Free the resource associated with a libhdfs connection.
 *
 * You must remove the connection from the tree before calling this function.
 *
 * @param conn            The libhdfs connection
 */
static void hdfsConnFree(struct hdfsConn *conn)
{
  int ret;

  ret = hdfsDisconnect(conn->fs);
  if (ret) {
    fprintf(stderr, "hdfsConnFree(username=%s): "
      "hdfsDisconnect failed with error %d\n",
      (conn->usrname ? conn->usrname : "(null)"), ret);
  }
  free(conn->usrname);
  free(conn->kpath);
  free(conn);
}

/**
 * Convert a time_t to a string.
 *
 * @param sec           time in seconds since the epoch
 * @param buf           (out param) output buffer
 * @param bufLen        length of output buffer
 *
 * @return              0 on success; ENAMETOOLONG if the provided buffer was
 *                      too short
 */

View on GitHub (pinned to 2add963021)

Solutions

  1. Check the libhdfs connection state; retry hdfsDisconnect or free the connection handle with hdfsConnFreeOnly after confirming no in-flight operations use it.
  2. Inspect errno/error code returned; ensure the underlying JVM is still alive before disconnecting.

When it happens

Trigger: Thrown at hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/fuse-dfs/fuse_connect.c:240 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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