{"record":{"id":"638c603947840875","repo":"apache/iceberg","slug":"failed-to-close-equality-delta-writer-638c60","errorCode":null,"errorMessage":"Failed to close equality delta writer","messagePattern":"Failed to close equality delta writer","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"error","filePath":"flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/sink/PartitionedDeltaWriter.java","lineNumber":97,"sourceCode":"      writer = new RowDataDeltaWriter(copiedKey, dvFileWriter());\n      writers.put(copiedKey, writer);\n    }\n\n    return writer;\n  }\n\n  @Override\n  public void close() {\n    try {\n      super.close();\n      Tasks.foreach(writers.values())\n          .throwFailureWhenFinished()\n          .noRetry()\n          .run(RowDataDeltaWriter::close, IOException.class);\n\n      writers.clear();\n    } catch (IOException e) {\n      throw new UncheckedIOException(\"Failed to close equality delta writer\", e);\n    }\n  }\n}\n","sourceCodeStart":79,"sourceCodeEnd":101,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/sink/PartitionedDeltaWriter.java#L79-L101","documentation":"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.","triggerScenarios":"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.","commonSituations":"S3/HDFS transient failures during checkpoint; parallel checkpoint abort racing with close; disk quota exceeded on TaskManager local buffers.","solutions":["Inspect the wrapped cause to find which file/storage failed; retry the checkpoint — Flink will restart the writer from the last completed checkpoint.","Verify storage connectivity/quotas (S3 rate limits, HDFS datanode health, local disk space).","Ensure the table's location is writable and not concurrently aborted by another failed subtask.","Enable retries for transient object-store errors in the FileIO configuration."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// ensure target location is writable and has free space before writing\nFileIO io = table.io();\nio.addInputToCleanup/* n/a */;\n// preflight: write and delete a probe file at table location\nString probe = table.location() + \"/.write-probe\";\nio.deleteFromOutputFile(io.newOutputFile().locate(probe).createOrOverwrite(0L));","typeGuard":null,"tryCatchPattern":"try {\n  writer.close();\n} catch (UncheckedIOException e) {\n  if (e.getMessage().equals(\"Failed to close equality delta writer\")) {\n    // let Flink restart strategy retry the failed checkpoint\n  }\n  throw e;\n}","preventionTips":["Configure a restart strategy so transient storage errors recover via checkpoint restart.","Monitor disk space and object-store rate limits on TaskManagers.","Avoid concurrent jobs writing to the same table location during checkpoints."],"tags":["flink","writer","io","checkpoint"],"backgroundTag":"file-write-failed","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}