apache/seatunnel · warning · RuntimeException

Interrupted during retry

Error message

Interrupted during retry

What it means

DynamoDbSinkClient.flushWithRetry retries failed batchWriteItem requests with sleeps between attempts. If the retry sleep is interrupted (Thread.interrupt from task cancellation or shutdown), it restores the interrupt flag and throws RuntimeException('Interrupted during retry') wrapping the InterruptedException.

Source

Thrown at seatunnel-connectors-v2/connector-amazondynamodb/src/main/java/org/apache/seatunnel/connectors/seatunnel/amazondynamodb/sink/DynamoDbSinkClient.java:183

                long delay = Math.min(baseDelayMs * (1L << retryCount), maxDelayMs);

                long jitter = (long) (delay * Math.random() * 0.5);
                delay += jitter;

                log.warn(
                        "Retrying batch write to table '{}': attempt {}/{}, "
                                + "{} unprocessed items remaining, retrying in {} ms",
                        tableName,
                        retryCount,
                        maxRetries,
                        pendingRequests.size(),
                        delay);

                try {
                    Thread.sleep(delay);
                } catch (InterruptedException e) {
                    Thread.currentThread().interrupt();
                    throw new RuntimeException("Interrupted during retry", e);
                }
            }
        }

        if (!pendingRequests.isEmpty()) {
            log.error(
                    "Failed to write {} items to table '{}' after {} retries",
                    pendingRequests.size(),
                    tableName,
                    maxRetries);

            throw new RuntimeException(
                    String.format(
                            "Failed to write %d items to table %s after %d retries",
                            pendingRequests.size(), tableName, maxRetries));
        }
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Expected during cancellation — treat as part of job shutdown; re-submit/restart the job and let checkpointing replay unflushed data.
  2. If unexpected, audit what interrupts sink threads (custom plugins, aggressive timeouts, manual Thread.interrupt calls).
  3. Reduce retry delays/attempt count so flushes finish quickly before cancellations occur.
  4. Ensure idempotent writes (unique keys) so interrupted/retried flushes are safe to redo.

Example fix

// before
Thread.sleep(60_000); // long backoff easily interrupted by cancel
// after
Thread.sleep(Math.min(delay, 5_000)); // short backoff, fewer interrupt windows
Defensive patterns

Strategy: try-catch

Validate before calling

null

Type guard

null

Try / catch

try { client.flushWithRetry(); } catch (RuntimeException e) { if (e.getCause() instanceof InterruptedException) { Thread.currentThread().interrupt(); /* graceful abort: checkpoint will replay */ } else { throw e; } }

Prevention

When it happens

Trigger: A batchWriteItem request fails with unprocessed items or throttling, the client enters its backoff Thread.sleep(delay), and the executing thread is interrupted (job cancel/failover, executor shutdown) before the delay elapses.

Common situations: Zeta task cancelled or checkpoint failed mid-flush; engine shutting down workers while a flush retry loop is sleeping; another component interrupting the sink thread.

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