{"record":{"id":"f4de7928fd89094b","repo":"apache/seatunnel","slug":"failed-to-close-equality-delta-writer","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":"seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/sink/writer/PartitionedDeltaWriter.java","lineNumber":92,"sourceCode":"            PartitionKey copiedKey = partitionKey.copy();\n            writer = new RowDataDeltaWriter(copiedKey);\n            writers.put(copiedKey, writer);\n        }\n\n        return writer;\n    }\n\n    @Override\n    public void close() {\n        try {\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":74,"sourceCodeEnd":96,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/sink/writer/PartitionedDeltaWriter.java#L74-L96","documentation":"PartitionedDeltaWriter.close() iterates all wrapped per-partition RowDataDeltaWriters and closes them via a tries-run; if any writer's close throws an IOException it is rethrown as an UncheckedIOException. This indicates the underlying Iceberg write (e.g. closing a parquet/avro file or committing writes to the file IO) failed while finalizing the sink.","triggerScenarios":"Closing the delta writers at sink checkpoint/close time when one of the per-partition writers fails to flush or close its data files (disk full, HDFS/S3 IO failure, corrupted output stream).","commonSituations":"Underlying object store (S3/HDFS/OSS) outages or credential expiry mid-write; disk quota exhaustion on worker nodes; network interruptions between worker and storage during checkpoint close.","solutions":["Inspect the wrapped IOException (cause) for the real storage/IO error and fix storage connectivity, credentials, or disk space first","Retry the job; transient storage failures during close are often recoverable from the last checkpoint","Verify the warehouse/URI config (hdfs path, s3a endpoint) is reachable from all worker nodes","If reproducible with one file, check for corrupted in-progress write files in the target table location and clean stale files"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// ensure target storage is reachable before submitting\n// hdfs dfs -test -e <warehouse.path> || s3 ls <s3a.warehouse>","typeGuard":null,"tryCatchPattern":"// engine-level: rely on checkpoint restart; at API level\ntry { deltaWriter.close(); } catch (UncheckedIOException e) { log.error(\"storage close failed\", e.getCause()); throw e; }","preventionTips":["Verify warehouse/storage connectivity and credentials from all worker nodes before submitting","Monitor disk space and object-store quotas","Keep checkpoints enabled so transient close failures recover","Clean stale in-progress files after failed jobs"],"tags":["iceberg","sink","io"],"backgroundTag":"file-write-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}