{"record":{"id":"a012bd426e1edb45","repo":"apache/seatunnel","slug":"failed-to-close-hbase-connection","errorCode":null,"errorMessage":"Failed to close HBase connection.","messagePattern":"Failed to close HBase connection\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-hbase/src/main/java/org/apache/seatunnel/connectors/seatunnel/hbase/source/HbaseSourceReader.java","lineNumber":112,"sourceCode":"                        column ->\n                                Preconditions.checkArgument(\n                                        column.contains(\":\") && column.split(\":\").length == 2,\n                                        \"Invalid column names, it should be [ColumnFamily:Column] format\"));\n        this.hbaseClient = hbaseClient;\n    }\n\n    @Override\n    public void open() throws Exception {\n        // do nothing\n    }\n\n    @Override\n    public void close() throws IOException {\n        if (this.hbaseClient != null) {\n            try {\n                this.hbaseClient.close();\n            } catch (Exception e) {\n                throw new IOException(\"Failed to close HBase connection.\", e);\n            }\n            log.info(\"Current HBase connection is closed.\");\n        }\n    }\n\n    @Override\n    public void pollNext(Collector<SeaTunnelRow> output) throws Exception {\n        synchronized (output.getCheckpointLock()) {\n            final HbaseSourceSplit split = sourceSplits.poll();\n            if (Objects.nonNull(split)) {\n                // read logic\n                try (ResultScanner scanner =\n                        hbaseClient.scan(split, hbaseParameters, this.columnNames)) {\n                    for (Result result : scanner) {\n                        SeaTunnelRow seaTunnelRow =\n                                hbaseDeserializationFormat.deserialize(\n                                        convertRawRow(result), seaTunnelRowType);\n                        output.collect(seaTunnelRow);","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hbase/src/main/java/org/apache/seatunnel/connectors/seatunnel/hbase/source/HbaseSourceReader.java#L94-L130","documentation":"HbaseSourceReader.close() wraps any exception from hbaseClient.close() into an IOException('Failed to close HBase connection.'). The reader throws this so the framework knows resource cleanup failed when the task is being torn down. It usually indicates an underlying problem shutting down the HBase client/connection (often a wrapped InterruptedException or IOException).","triggerScenarios":"Task cancellation or checkpoint/teardown invoking HbaseSourceReader.close() while hbaseClient.close() (closing the Connection/Table resources) throws — e.g. interrupted thread during job cancel or connection already aborted.","commonSituations":"Cancelling a running job mid-scan; ZK/session already expired so close() fails; thread interrupt during cleanup.","solutions":["Check the cause chain for the real failure (often InterruptedException during cancel — usually benign)","Verify HBase cluster/ZK is reachable so close can complete cleanly","If it only occurs on cancel, it is typically harmless; investigate only if it happens in normal teardown","Upgrade/check client resource management; ensure close is called once"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    reader.close();\n} catch (IOException e) {\n    log.warn(\"HBase reader close failed: {}\", e.getCause(), e); // usually benign during cancel\n}","preventionTips":["Treat close failures during job cancellation as benign unless recurring","Keep HBase/ZK session healthy to allow clean close","Ensure each reader closes its client exactly once","Inspect the cause chain (often InterruptedException) before escalating"],"tags":["hbase","resource-cleanup","connection-close","io-exception"],"backgroundTag":"broken-pipe","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}