apache/seatunnel · warning

Error closing potentially broken REST client: {}

Error message

Error closing potentially broken REST client: {}

What it means

Logged by HugeGraphClient.reconnect() when closing the underlying RestClient throws an exception. As with the primary client, the error is swallowed, restClient and all derived API/schema references are nulled, and a fresh client is built on the next operation. It indicates the REST layer was in an unrecoverable state.

Source

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

            }
        }
    }

    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;
        this.schema = null;
    }

    private void createPageApis(HugeGraphConnectionConfig config) {
        String url = buildServerUrl(config);
        String graphSpace =
                config.getGraphSpace() != null ? config.getGraphSpace() : DEFAULT_GRAPH_SPACE;
        RestClientConfig restClientConfig =
                RestClientConfig.builder()
                        .user(config.getUsername() == null ? "" : config.getUsername())
                        .password(config.getPassword() == null ? "" : config.getPassword())
                        .build();
        this.restClient = new RestClient(url, restClientConfig);

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Usually benign: the client is rebuilt after reconnect, no user action required
  2. If persistent, restart the SeaTunnel worker/node to clear any broken I/O reactor state
  3. Check HugeGraph server logs around the same timestamp for crashes or OOM
  4. Tune connection/timeout settings to avoid abrupt socket teardowns
Defensive patterns

Strategy: retry

Try / catch

// Benign after reconnect; escalate only if writes ultimately fail:
try {
    sinkWrite();
} catch (HugeGraphConnectorException e) {
    // BUILD_CLIENT_FAILED after retries -> check server/I/O reactor health
    throw e;
}

Prevention

When it happens

Trigger: restClient.close() fails during reconnect after a connection-level error — typically because the low-level HTTP client's I/O reactor is already shut down or its selector is in a bad state after a socket error.

Common situations: Sudden server termination mid-request, I/O reactor shutdown due to a fatal network error, or JVM resource exhaustion preventing clean HTTP client shutdown.

Related errors


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