{"record":{"id":"e0d446f57d64820f","repo":"apache/seatunnel","slug":"connection-retry-sleep-interrupted-by-exception","errorCode":null,"errorMessage":"Connection retry sleep interrupted by exception: ","messagePattern":"Connection retry sleep interrupted by exception: ","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/io/debezium/connector/postgresql/PostgresObjectUtils.java","lineNumber":116,"sourceCode":"                retryCount++;\n                if (retryCount > maxRetries) {\n                    log.error(\n                            \"Too many errors connecting to server. All {} retries failed.\",\n                            maxRetries);\n                    throw new ConnectException(ex);\n                }\n\n                log.warn(\n                        \"Error connecting to server; will attempt retry {} of {} after {} \"\n                                + \"seconds. Exception message: {}\",\n                        retryCount,\n                        maxRetries,\n                        retryDelay.getSeconds(),\n                        ex.getMessage());\n                try {\n                    metronome.pause();\n                } catch (InterruptedException e) {\n                    log.warn(\"Connection retry sleep interrupted by exception: \" + e);\n                    Thread.currentThread().interrupt();\n                }\n            }\n        }\n        throw new SeaTunnelRuntimeException(CREATE_REPLICATION_CONNECTION_FAILED, \"\" + taskContext);\n    }\n}\n","sourceCodeStart":98,"sourceCodeEnd":124,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/io/debezium/connector/postgresql/PostgresObjectUtils.java#L98-L124","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// verify replication prerequisites before connecting\n// SELECT wal_level FROM pg_settings;  -- must be 'logical'\n// SELECT slot_name FROM pg_replication_slots WHERE slot_name = ?;\n// SELECT rolreplication FROM pg_roles WHERE rolname = ?;","typeGuard":null,"tryCatchPattern":"try {\n    createReplicationConnection(...);\n} catch (SeaTunnelRuntimeException e) {\n    // inspect per-attempt errors; check slot, wal_level, credentials, network\n}","preventionTips":["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"],"tags":["cdc","postgres","replication","retry","interrupted"],"backgroundTag":"connection-refused","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}