apache/hadoop · error · UnsupportedOperationException

Cannot call isFileClosed on a symlink to a non-DistributedFi

Error message

Cannot call isFileClosed on a symlink to a non-DistributedFileSystem: {} -> {}

What it means

Error "Cannot call isFileClosed on a symlink to a non-DistributedFileSystem: {} -> {}" thrown in apache/hadoop.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java:2649

   * @throws IOException If an I/O error occurred
   */
  @Override
  public boolean isFileClosed(final Path src) throws IOException {
    Path absF = fixRelativePart(src);
    return new FileSystemLinkResolver<Boolean>() {
      @Override
      public Boolean doCall(final Path p) throws IOException {
        return dfs.isFileClosed(getPathName(p));
      }

      @Override
      public Boolean next(final FileSystem fs, final Path p)
          throws IOException {
        if (fs instanceof DistributedFileSystem) {
          DistributedFileSystem myDfs = (DistributedFileSystem)fs;
          return myDfs.isFileClosed(p);
        } else {
          throw new UnsupportedOperationException("Cannot call isFileClosed"
              + " on a symlink to a non-DistributedFileSystem: "
              + src + " -> " + p);
        }
      }
    }.resolve(this, absF);
  }

  /**
   * @see #addCacheDirective(CacheDirectiveInfo, EnumSet)
   */
  public long addCacheDirective(CacheDirectiveInfo info) throws IOException {
    return addCacheDirective(info, EnumSet.noneOf(CacheFlag.class));
  }

  /**
   * Add a new CacheDirective.
   *
   * @param info Information about a directive to add.

View on GitHub (pinned to 2add963021)

Solutions

  1. Call isFileClosed on the actual HDFS path rather than through a symlink to a non-DistributedFileSystem.
  2. Resolve the symlink target and use the target's DistributedFileSystem.

When it happens

Trigger: isFileClosed is called on a path that is a symlink to a non-DistributedFileSystem, which does not expose the HDFS file-closed state.

Common situations: See trigger scenarios.


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