apache/seatunnel · warning

Connection issue detected. Forcing reconnection...

Error message

Connection issue detected. Forcing reconnection...

What it means

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.

Source

Thrown at seatunnel-connectors-v2/connector-hugegraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/client/HugeGraphClient.java:147

            try {
                this.client = createClient(this.config);
                this.schema = this.client.schema();
                createPageApis(this.config);
                LOG.info("HugeClient initialized successfully.");
            } catch (Exception e) {
                // Avoid leaking a partially-opened client (e.g. createPageApis failed after the
                // HugeClient was created) — release everything before surfacing the failure.
                reconnect();
                throw new HugeGraphConnectorException(
                        HugeGraphConnectorErrorCode.BUILD_CLIENT_FAILED,
                        "Failed to establish initial connection",
                        e);
            }
        }
    }

    private void reconnect() {
        LOG.warn("Connection issue detected. Forcing reconnection...");
        if (this.client != null) {
            try {
                this.client.close();
            } catch (Exception e) {
                LOG.warn("Error closing potentially broken client: {}", e.getMessage());
            }
        }
        this.client = null;
        if (this.restClient != null) {
            try {
                this.restClient.close();
            } catch (Exception e) {
                LOG.warn("Error closing potentially broken REST client: {}", e.getMessage());
            }
        }
        this.restClient = null;
        this.vertexAPI = null;
        this.edgeAPI = null;

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Check HugeGraph server availability and address (host/port) in the sink/source configuration
  2. Inspect preceding logs for the root connection exception (timeout, refused, unknown host)
  3. Verify network/firewall rules between SeaTunnel workers and the HugeGraph REST port
  4. If reconnects recur, tune retry attempts/timeout options and investigate server-side load
Defensive patterns

Strategy: retry

Validate before calling

// Before job submission
curl -sf http://hugegraph-host:8080/graphs || echo "HugeGraph unreachable"

Try / catch

// The client auto-reconnects; at the job level wrap the sink write phase
try {
    sinkWrite();
} catch (HugeGraphConnectorException e) {
    if ("BUILD_CLIENT_FAILED".equals(e.getErrorCode())) {
        // schedule job retry after checking server health
    }
    throw e;
}

Prevention

When it happens

Trigger: Invoked from ensureClientInitialized, executeGraphOperation, or executeReadOperation when a request throws a connection-level exception (ConnectException, timeout, unknown host, socket reset) against the HugeGraph server.

Common situations: 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.

Understand the failure class

Background: ECONNREFUSED and "connection refused" / "could not connect to server" errors: what they mean and how to fix them — this error's family across 44 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/8dadb550dc20d96f. Report an issue: GitHub.