apache/iceberg · warning · UncheckedIOException

Failed to close parallel iterable

Error message

Failed to close parallel iterable

What it means

In reachableManifests(), if closing the ParallelIterable of manifest iterables fails with IOException, it is rethrown as UncheckedIOException with 'Failed to close parallel iterable'. This is a cleanup-path failure: the manifests themselves were being gathered via a parallel executor and closing the composite CloseableIterable raised. It usually indicates an underlying IO problem in a worker task's close routine.

Source

Thrown at core/src/main/java/org/apache/iceberg/BaseAllMetadataTableScan.java:84

        "Scanning metadata table {} with filter {}.",
        metadataTableName,
        ExpressionUtil.toSanitizedString(filter()));
    Listeners.notifyAll(new ScanEvent(metadataTableName, 0L, filter(), schema()));

    return doPlanFiles();
  }

  protected CloseableIterable<ManifestFile> reachableManifests(
      Function<Snapshot, Iterable<ManifestFile>> toManifests) {
    Iterable<Snapshot> snapshots = table().snapshots();
    Iterable<Iterable<ManifestFile>> manifestIterables =
        Iterables.transform(snapshots, toManifests);

    try (CloseableIterable<ManifestFile> iterable =
        new ParallelIterable<>(manifestIterables, planExecutor())) {
      return CloseableIterable.withNoopClose(Sets.newHashSet(iterable));
    } catch (IOException e) {
      throw new UncheckedIOException("Failed to close parallel iterable", e);
    }
  }
}

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Inspect the cause IOException in the UncheckedIOException for the real storage error
  2. Retry the scan; transient storage faults often resolve
  3. Check planExecutor thread-pool health and sizing
  4. Verify storage endpoint stability/credentials for manifest list reads

Example fix

// before
Iterable<ManifestFile> manifests = scan.reachableManifests(); // throws UncheckedIOException on close
// after
try {
  Iterable<ManifestFile> manifests = scan.reachableManifests();
} catch (UncheckedIOException e) {
  LOG.warn("Retrying after close failure", e.getCause());
  manifests = scan.reachableManifests(); // transient IO during close
}
Defensive patterns

Strategy: retry

Validate before calling

null

Type guard

null

Try / catch

try { manifests = scan.reachableManifests(); } catch (UncheckedIOException e) { Throwable c = e.getCause(); /* inspect and retry if transient */ }

Prevention

When it happens

Trigger: Planning an all_* metadata table scan over many snapshots where one ParallelIterable worker's underlying manifest iterator throws IOException during close().

Common situations: Object-store connection resets during task teardown; executor shutdown racing with close; disk/network failures while draining streams.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/b2adc92ed7a99c5d. Report an issue: GitHub.