apache/seatunnel · warning

Scheduler timed out during close; up to {} ringbuffer event(

Error message

Scheduler timed out during close; up to {} ringbuffer event(s) were not flushed to disk. Local buffer (cap={}) will be drained as fallback.

What it means

During close(), if the report scheduler does not terminate within the timeout, the handler estimates how many ring buffer events were not flushed to disk (tailSequence - committedEventIndex + 1) and logs this warning, noting that the in-memory local buffer (capacity LOCAL_EVENT_BUFFER_CAPACITY) will be drained as a fallback.

Source

Thrown at seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/event/JobEventLocalFileHandler.java:422

            } catch (IOException e) {
                log.error("Failed to flush events on close", e);
            }
        } else {
            // Scheduler did not stop within the timeout.  Interrupt it so any blocking
            // Hazelcast call (readManyAsync / CompletableFuture.join) is unblocked.
            scheduledExecutorService.shutdownNow();
            boolean finallyTerminated = false;
            try {
                finallyTerminated = scheduledExecutorService.awaitTermination(2, TimeUnit.SECONDS);
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
            }
            // Log how many ringbuffer events may have been skipped for observability.
            try {
                long tail = ringbuffer.tailSequence();
                long unsynced = tail - committedEventIndex + 1;
                if (unsynced > 0) {
                    log.warn(
                            "Scheduler timed out during close; up to {} ringbuffer event(s) were"
                                    + " not flushed to disk. Local buffer (cap={}) will be drained"
                                    + " as fallback.",
                            unsynced,
                            LOCAL_EVENT_BUFFER_CAPACITY);
                }
            } catch (Exception e) {
                log.warn(
                        "Scheduler timed out during close; relying on local buffer as fallback."
                                + " Could not determine dropped event count: {}",
                        e.getMessage());
            }
            if (!finallyTerminated) {
                // The scheduler thread is still alive even after shutdownNow().  Draining
                // the local buffer here would race with the scheduler on writerLock.
                // closing=true already prevents the scheduler from opening new files,
                // so we can safely close the current writer under the lock and return.
                log.warn(

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Ensure the scheduler can drain promptly — check disk write throughput and trace event volume.
  2. Increase the scheduler shutdown timeout in close() if large backlogs are expected.
  3. Rely on the local buffer fallback, but note events beyond its capacity are lost; reduce trace verbosity at high throughput.

Example fix

null
Defensive patterns

Strategy: fallback

Try / catch

try { handler.close(); } catch (Exception e) { log.warn("trace handler close incomplete; some events may be unflushed", e); }

Prevention

When it happens

Trigger: JobEventLocalFileHandler.close() is called while the scheduler is still running (awaitTermination timed out) and tailSequence() is ahead of committedEventIndex, so some events may never reach the trace file.

Common situations: Cluster/node shutdown while trace events are being produced faster than the scheduler drains them; disk I/O slowness delaying the write loop past the shutdown timeout.

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/1c49bcf98082f97e. Report an issue: GitHub.