apache/seatunnel · warning

Close scanner from {} failed.

Error message

Close scanner from {} failed.

What it means

closeScanner catches TException from the close RPC, logging this warning per failed attempt, then unconditionally proceeds to close the client and logs success. Because close is best-effort, this does not fail the job, but the BE-side scan context may not be released, risking leaked contexts on the BE.

Source

Thrown at seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/backend/BackendClient.java:248

        for (int attempt = 0; attempt < retries; ++attempt) {
            log.debug("Attempt {} to closeScanner {}.", attempt, routing);
            try {
                TScanCloseResult result = client.closeScanner(closeParams);
                if (result == null) {
                    log.warn("CloseScanner result from {} is null.", routing);
                    continue;
                }
                if (!TStatusCode.OK.equals(result.getStatus().getStatusCode())) {
                    log.warn(
                            "The status of get next result from {} is '{}', error message is: {}.",
                            routing,
                            result.getStatus().getStatusCode(),
                            result.getStatus().getErrorMsgs());
                    continue;
                }
                break;
            } catch (TException e) {
                log.warn("Close scanner from {} failed.", routing, e);
            }
        }
        log.info("CloseScanner to Doris BE '{}' success.", routing);
        close();
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Safe to ignore in most cases: contexts expire on the BE after the timeout.
  2. If scan contexts accumulate, clean them up on the BE or restart the BE.
  3. Investigate the underlying read/network failure that broke the connection before close.
  4. Keep connector/Doris versions aligned to avoid protocol exceptions during close.
Defensive patterns

Strategy: try-catch

Try / catch

// TException during closeScanner is swallowed (logged) and close proceeds — no caller catch needed.
// Treat repeated occurrences as a symptom of earlier transport failures and fix the root cause.

Prevention

When it happens

Trigger: client.closeScanner throws TException on any attempt — connection already broken (common after a read failure or job cancel), BE unreachable during teardown, or thrift protocol error.

Common situations: Teardown after a failed read where the transport is already dead; job cancellation; network loss at end of read; BE restart before cleanup.

Related errors


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