apache/seatunnel · critical · SelectDBConnectorException

STAGE_LOAD_FAILED

STAGE_LOAD_FAILED

Error message

offer data to queue timeout, exceed 

What it means

SelectDBStageLoad feeds RecordBuffers into an internal ArrayBlockingQueue consumed by the async stage-load thread. offer() waits up to 600 seconds for space; if the queue is still full (consumer stalled or dead), it throws SelectDBConnectorException with code STAGE_LOAD_FAILED.

Solutions

  1. Check worker logs for an earlier exception in the async load thread — the queue-full timeout is usually a secondary symptom
  2. Verify network connectivity and response times to the SelectDB Cloud internal stage endpoint
  3. Reduce sink batch size/buffer limits to lower per-upload latency and increase throughput
  4. Restart the job after fixing the root cause; consider increasing the 600s offer timeout for very slow storage
Defensive patterns

Strategy: retry

Validate before calling

// health-check the SelectDB endpoint and monitor queue depth before/at flush
if (queue.remainingCapacity() == 0) { log.warn("stage-load queue saturated"); }

Try / catch

try { sink.flush(); } catch (SelectDBConnectorException e) { if (e.getErrorCode() == SelectDBConnectorErrorCode.STAGE_LOAD_FAILED) { /* restart job after checking load-thread logs */ } }

Prevention

When it happens

Trigger: The async load thread is blocked or crashed (e.g. slow/hung HTTP upload to SelectDB, or it died with an unhandled exception) so the queue stays full for 600s while flush() or waitAsyncLoadFinish() calls offer().

Common situations: SelectDB Cloud endpoint slow or unreachable (network issues, DNS, proxy); load thread killed earlier by a prior exception; batch too large making uploads take longer than the offer window in a saturated pipeline.

Understand the failure class

Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.

Related errors


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

Appendix: source

Thrown at seatunnel-connectors-v2/connector-selectdb-cloud/src/main/java/org/apache/seatunnel/connectors/selectdb/sink/writer/SelectDBStageLoad.java:154

        if (buffer == null) {
            return;
        }
        String fileName =
                labelGenerator.generateLabel(currentCheckpointID, fileNum.getAndIncrement());
        buffer.setFileName(fileName);
        RecordBuffer tmpBuff = buffer;
        log.info("flush buffer to queue, actual queue size {}", queue.size());
        offer(tmpBuff);
        if (waitUtilDone) {
            waitAsyncLoadFinish();
        }
        this.buffer = new RecordBuffer(this.lineDelimiter);
    }

    private void offer(RecordBuffer buffer) throws InterruptedException {
        checkFlushException();
        if (!queue.offer(buffer, 600 * 1000, TimeUnit.MILLISECONDS)) {
            throw new SelectDBConnectorException(
                    SelectDBConnectorErrorCode.STAGE_LOAD_FAILED,
                    "offer data to queue timeout, exceed ");
        }
    }

    private void checkFlushException() {
        if (exception.get() != null) {
            throw new SelectDBConnectorException(
                    SelectDBConnectorErrorCode.STAGE_LOAD_FAILED, exception.get());
        }
    }

    private void waitAsyncLoadFinish() throws InterruptedException {
        for (int i = 0; i < selectdbConfig.getFlushQueueSize() + 1; i++) {
            offer(new RecordBuffer());
        }
    }

View on GitHub (pinned to cf67b549a7)