{"record":{"id":"70c85e8b43a9c9c8","repo":"apache/iceberg","slug":"failed-to-close-equality-delta-writer-70c85e","errorCode":null,"errorMessage":"Failed to close equality delta writer","messagePattern":"Failed to close equality delta writer","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"critical","filePath":"flink/v2.1/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.1/flink/src/main/java/org/apache/iceberg/flink/sink/PartitionedDeltaWriter.java#L79-L101","documentation":"PartitionedDeltaWriter.close() closes all underlying RowDataDeltaWriters via Tasks, collecting IOExceptions. If any writer fails to close, the IOException is wrapped in an UncheckedIOException with this message. It indicates a failure flushing/closing files or manifests during writer teardown.","triggerScenarios":"Closing the partitioned writer when an underlying delta writer (data file writer or equality-delete writer) throws IOException during close — e.g. failing to close an Avro/Parquet file, closing an already-closed writer, or filesystem errors during flush.","commonSituations":"Underlying object store issues (transient S3/HDFS failures) during checkpoint; task failure/cancellation racing with close; disk full on local buffer directories.","solutions":["Inspect the cause (UncheckedIOException.getCause()) for the real writer-level IOException and fix that root problem.","Check filesystem/object-store connectivity, credentials, and disk space on local spill directories.","Retry the failed checkpoint/task; transient object store errors are the most common cause.","Verify no double-close is happening in custom code that also closes writers on failure paths."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// at checkpoint/failure handler\ntry {\n  writer.close();\n} catch (UncheckedIOException e) {\n  LOG.error(\"Writer close failed; cause: {}\", e.getCause(), e);\n  // let Flink restart strategy retry the checkpoint/task\n  throw e;\n}","preventionTips":["Monitor object-store error rates and disk space on TaskManagers.","Enable Flink restart strategies for transient IO failures.","Avoid custom code paths that double-close writers."],"tags":["flink","writer","io","checkpointing"],"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"}