{"record":{"id":"c8698270faf3a7f6","repo":"apache/seatunnel","slug":"failed-to-close-failure-data-writer-cause","errorCode":null,"errorMessage":"Failed to close failure-data writer. cause={}","messagePattern":"Failed to close failure-data writer\\. cause=(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-hugegraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/buffer/BatchBuffer.java","lineNumber":440,"sourceCode":"            }\n            closed = true;\n        }\n\n        LOG.info(\"Closing BatchBuffer, performing final flush...\");\n        try {\n            flush();\n        } finally {\n            closeFailureWriter();\n        }\n        LOG.info(\"BatchBuffer closed.\");\n    }\n\n    private void closeFailureWriter() {\n        if (failureWriter != null) {\n            try {\n                failureWriter.close();\n            } catch (IOException e) {\n                LOG.warn(\"Failed to close failure-data writer. cause={}\", e.getMessage());\n            } finally {\n                failureWriter = null;\n            }\n        }\n    }\n}\n","sourceCodeStart":422,"sourceCodeEnd":447,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hugegraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/buffer/BatchBuffer.java#L422-L447","documentation":"Logged by BatchBuffer.closeFailureWriter during task close() when closing the BufferedWriter for the failure-data file throws an IOException. The reference is nulled in a finally block so no leak persists; the warning only means buffered failure samples may not have been fully flushed to disk at close time.","triggerScenarios":"failureWriter.close() throws IOException during the sink's close lifecycle: disk full while flushing remaining buffered lines, the underlying file was removed/unclosed mount, or the filesystem became unavailable before job shutdown. Called once from close().","commonSituations":"Disk-full on the worker during shutdown, NFS/network mounts dropped mid-job, or container shutdown racing with the flush of the failure-sample file.","solutions":["Check disk space and mount health on the worker node at job shutdown","Review the failure-data file for truncated final lines; treat the last sample as possibly incomplete","Ensure the failureDataPath points to reliable local storage rather than a flaky network mount","This is logged as WARN and does not fail the job; re-run data validation if failure samples matter for auditing"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// The connector already swallows this; treat it as advisory:\n// after close(), optionally verify the failure file is complete\nif (!failureFileComplete(failureDataPath)) {\n    LOG.warn(\"failure samples may be truncated due to close error\");\n}","preventionTips":["Use reliable local storage (not flaky network mounts) for failureDataPath","Keep adequate disk headroom so close-time flush cannot fail from disk-full","Avoid external cleanup cron jobs that delete files under running jobs","Validate failure-sample contents after jobs that logged this warning"],"tags":["hugegraph","io","resource-cleanup","file-write"],"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"}