apache/iceberg · error · UncheckedIOException

Failed to close equality delta writer

Error message

Failed to close equality delta writer

What it means

PartitionedDeltaWriter.close runs RowDataDeltaWriter::close for every per-partition writer via Tasks; an IOException from any writer is rethrown as UncheckedIOException with this message. It means one of the equality-delta writers failed while flushing/rolling its data or delete files during close.

Source

Thrown at flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/sink/PartitionedDeltaWriter.java:97

      writer = new RowDataDeltaWriter(copiedKey, dvFileWriter());
      writers.put(copiedKey, writer);
    }

    return writer;
  }

  @Override
  public void close() {
    try {
      super.close();
      Tasks.foreach(writers.values())
          .throwFailureWhenFinished()
          .noRetry()
          .run(RowDataDeltaWriter::close, IOException.class);

      writers.clear();
    } catch (IOException e) {
      throw new UncheckedIOException("Failed to close equality delta writer", e);
    }
  }
}

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Inspect the wrapped cause to find which file/storage failed; retry the checkpoint — Flink will restart the writer from the last completed checkpoint.
  2. Verify storage connectivity/quotas (S3 rate limits, HDFS datanode health, local disk space).
  3. Ensure the table's location is writable and not concurrently aborted by another failed subtask.
  4. Enable retries for transient object-store errors in the FileIO configuration.
Defensive patterns

Strategy: retry

Validate before calling

// ensure target location is writable and has free space before writing
FileIO io = table.io();
io.addInputToCleanup/* n/a */;
// preflight: write and delete a probe file at table location
String probe = table.location() + "/.write-probe";
io.deleteFromOutputFile(io.newOutputFile().locate(probe).createOrOverwrite(0L));

Try / catch

try {
  writer.close();
} catch (UncheckedIOException e) {
  if (e.getMessage().equals("Failed to close equality delta writer")) {
    // let Flink restart strategy retry the failed checkpoint
  }
  throw e;
}

Prevention

When it happens

Trigger: Closing the writer after writing rows where an underlying data/delete file write or abort fails — disk full, object store errors, file already aborted in a prior checkpoint failure, or IO errors in the delegate writer.

Common situations: S3/HDFS transient failures during checkpoint; parallel checkpoint abort racing with close; disk quota exceeded on TaskManager local buffers.

Understand the failure class

Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.

Related errors


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