apache/seatunnel · warning
Connection retry sleep interrupted by exception:
Error message
Connection retry sleep interrupted by exception:
What it means
PostgresObjectUtils.createReplicationConnection() retries connecting to the PostgreSQL replication slot; when the retry sleep (metronome.pause()) is interrupted it logs 'Connection retry sleep interrupted by exception: ' at WARN and restores the interrupt flag. If all retries are exhausted without success, it throws SeaTunnelRuntimeException (CREATE_REPLICATION_CONNECTION_FAILED).
Source
Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/io/debezium/connector/postgresql/PostgresObjectUtils.java:116
retryCount++;
if (retryCount > maxRetries) {
log.error(
"Too many errors connecting to server. All {} retries failed.",
maxRetries);
throw new ConnectException(ex);
}
log.warn(
"Error connecting to server; will attempt retry {} of {} after {} "
+ "seconds. Exception message: {}",
retryCount,
maxRetries,
retryDelay.getSeconds(),
ex.getMessage());
try {
metronome.pause();
} catch (InterruptedException e) {
log.warn("Connection retry sleep interrupted by exception: " + e);
Thread.currentThread().interrupt();
}
}
}
throw new SeaTunnelRuntimeException(CREATE_REPLICATION_CONNECTION_FAILED, "" + taskContext);
}
}
View on GitHub (pinned to cf67b549a7)
Solutions
- If this WARN appeared during intentional shutdown, ignore it.
- Otherwise inspect the final SeaTunnelRuntimeException message for the underlying connection errors from each retry.
- Verify the replication slot exists (SELECT * FROM pg_replication_slots) and wal_level=logical on the server.
- Check Postgres credentials and that the user has REPLICATION privilege; increase maxRetries/retryDelay config if the DB is slow to become available.
Defensive patterns
Strategy: retry
Validate before calling
// verify replication prerequisites before connecting // SELECT wal_level FROM pg_settings; -- must be 'logical' // SELECT slot_name FROM pg_replication_slots WHERE slot_name = ?; // SELECT rolreplication FROM pg_roles WHERE rolname = ?;
Try / catch
try {
createReplicationConnection(...);
} catch (SeaTunnelRuntimeException e) {
// inspect per-attempt errors; check slot, wal_level, credentials, network
} Prevention
- Confirm wal_level=logical and the slot/publication exist before running
- Grant REPLICATION privilege to the CDC user
- Tune maxRetries/retryDelay for slow-starting databases
- Ensure the job is not cancelled during the startup retry window
When it happens
Trigger: All replication-connection attempts fail (slot missing, auth failure, wal_level not logical, network refused); while sleeping between retries, the task thread is interrupted (job cancel/stop, engine failover), triggering this message.
Common situations: Max retries exhausted due to wrong slot name or missing publication; wal_level=max_replication_slots misconfigured on Postgres; job cancelled during startup retry loop; REPLICA IDENTITY / replication privilege problems.
Understand the failure class
Background: ECONNREFUSED and "connection refused" / "could not connect to server" errors: what they mean and how to fix them — this error's family across 44 libraries.
Related errors
- Failed to start replication stream at <lsn>
- received unexpected exception will perform keep alive
- CREATE_REPLICATION_CONNECTION_FAILED
- Error getting current Lsn/txId ${e.getMessage()}
- Snapshot was interrupted before completion
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/e0d446f57d64820f.
Report an issue: GitHub.