{"record":{"id":"8dadb550dc20d96f","repo":"apache/seatunnel","slug":"connection-issue-detected-forcing-reconnection","errorCode":null,"errorMessage":"Connection issue detected. Forcing reconnection...","messagePattern":"Connection issue detected\\. Forcing reconnection\\.\\.\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-hugegraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/client/HugeGraphClient.java","lineNumber":147,"sourceCode":"            try {\n                this.client = createClient(this.config);\n                this.schema = this.client.schema();\n                createPageApis(this.config);\n                LOG.info(\"HugeClient initialized successfully.\");\n            } catch (Exception e) {\n                // Avoid leaking a partially-opened client (e.g. createPageApis failed after the\n                // HugeClient was created) — release everything before surfacing the failure.\n                reconnect();\n                throw new HugeGraphConnectorException(\n                        HugeGraphConnectorErrorCode.BUILD_CLIENT_FAILED,\n                        \"Failed to establish initial connection\",\n                        e);\n            }\n        }\n    }\n\n    private void reconnect() {\n        LOG.warn(\"Connection issue detected. Forcing reconnection...\");\n        if (this.client != null) {\n            try {\n                this.client.close();\n            } catch (Exception e) {\n                LOG.warn(\"Error closing potentially broken client: {}\", e.getMessage());\n            }\n        }\n        this.client = null;\n        if (this.restClient != null) {\n            try {\n                this.restClient.close();\n            } catch (Exception e) {\n                LOG.warn(\"Error closing potentially broken REST client: {}\", e.getMessage());\n            }\n        }\n        this.restClient = null;\n        this.vertexAPI = null;\n        this.edgeAPI = null;","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hugegraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/client/HugeGraphClient.java#L129-L165","documentation":"Logged as WARN by HugeGraphClient.reconnect() when a connection issue is detected and the client is about to be torn down and rebuilt. It closes the current HugeClient instance (swallowing close errors) before nulling references so the next operation recreates them. This is an expected part of the retry/reconnect loop, not a failure by itself.","triggerScenarios":"Invoked from ensureClientInitialized, executeGraphOperation, or executeReadOperation when a request throws a connection-level exception (ConnectException, timeout, unknown host, socket reset) against the HugeGraph server.","commonSituations":"HugeGraph server restarted or briefly unavailable, network blips between SeaTunnel worker and server, load balancer idle-timeout dropping keep-alive connections, or wrong host/port making the initial connection fail.","solutions":["Check HugeGraph server availability and address (host/port) in the sink/source configuration","Inspect preceding logs for the root connection exception (timeout, refused, unknown host)","Verify network/firewall rules between SeaTunnel workers and the HugeGraph REST port","If reconnects recur, tune retry attempts/timeout options and investigate server-side load"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Before job submission\ncurl -sf http://hugegraph-host:8080/graphs || echo \"HugeGraph unreachable\"","typeGuard":null,"tryCatchPattern":"// The client auto-reconnects; at the job level wrap the sink write phase\ntry {\n    sinkWrite();\n} catch (HugeGraphConnectorException e) {\n    if (\"BUILD_CLIENT_FAILED\".equals(e.getErrorCode())) {\n        // schedule job retry after checking server health\n    }\n    throw e;\n}","preventionTips":["Health-check the HugeGraph endpoint before starting the job","Raise LB/firewall idle timeouts above the job's inter-request gaps","Monitor server GC pauses and restarts that trigger client reconnects","Keep connector retry/timeout options sized to your network's reliability"],"tags":["hugegraph","connection","retry","client"],"backgroundTag":"connection-refused","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}