{"record":{"id":"364ec3776969bfa8","repo":"conductor-oss/conductor","slug":"timeout-while-connecting-to-addresses","errorCode":null,"errorMessage":"Timeout while connecting to <addresses>","messagePattern":"Timeout while connecting to <addresses>","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"amqp/src/main/java/com/netflix/conductor/contribs/queue/amqp/AMQPConnection.java","lineNumber":154,"sourceCode":"                    final String error =\n                            \"Retries completed. IO error while connecting to \"\n                                    + Arrays.stream(addresses)\n                                            .map(address -> address.toString())\n                                            .collect(Collectors.joining(\",\"));\n                    LOGGER.error(error, e);\n                    throw new RuntimeException(error, e);\n                }\n                retryIndex++;\n            } catch (final TimeoutException e) {\n                AMQPRetryPattern retry = retrySettings;\n                if (retry == null) {\n                    final String error =\n                            \"Timeout while connecting to \"\n                                    + Arrays.stream(addresses)\n                                            .map(address -> address.toString())\n                                            .collect(Collectors.joining(\",\"));\n                    LOGGER.error(error, e);\n                    throw new RuntimeException(error, e);\n                }\n                try {\n                    retry.continueOrPropogate(e, retryIndex);\n                } catch (Exception ex) {\n                    final String error =\n                            \"Retries completed. Timeout while connecting to \"\n                                    + Arrays.stream(addresses)\n                                            .map(address -> address.toString())\n                                            .collect(Collectors.joining(\",\"));\n                    LOGGER.error(error, e);\n                    throw new RuntimeException(error, e);\n                }\n                retryIndex++;\n            }\n        }\n    }\n\n    public Channel getOrCreateChannel(ConnectionType connectionType, String queueOrExchangeName)","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/amqp/src/main/java/com/netflix/conductor/contribs/queue/amqp/AMQPConnection.java#L136-L172","documentation":"createConnection caught a TimeoutException from factory.newConnection and retrySettings is null, so it propagates immediately. TimeoutException means the AMQP handshake did not complete within the connection timeout configured on the factory (set via properties.getConnectionTimeoutInMilliSecs).","triggerScenarios":"getOrCreateChannel triggers createConnection; the broker is reachable on the TCP socket but the AMQP handshake does not complete in time; retrySettings is null so the no-retry branch throws.","commonSituations":"Broker overloaded and slow to handshake; high network latency exceeding the connection timeout; a stateful firewall that allows the SYN but drops subsequent handshake packets; connection timeout configured too low.","solutions":["Increase the connection timeout via AMQPEventQueueProperties.connectionTimeoutInMilliSecs (it is passed to factory.setConnectionTimeout).","Measure round-trip latency to the broker and confirm the timeout exceeds it with headroom.","Check broker CPU/load during the connection attempt.","Wire an AMQPRetryPattern so transient timeouts are retried instead of failing fast."],"exampleFix":"# before: handshake times out under latency\nconductor.amqp.connectionTimeoutInMilliSecs=2000\n\n# after: give the handshake room\nconductor.amqp.connectionTimeoutInMilliSecs=10000","handlingStrategy":"retry","validationCode":"// Sanity-check the configured timeout against measured latency before building\nlong rtt = measureRoundTrip(host, port);\nif (rtt >= properties.getConnectionTimeoutInMilliSecs()) {\n    throw new IllegalStateException(\"connection timeout \"\n        + properties.getConnectionTimeoutInMilliSecs()\n        + \"ms is below measured RTT \" + rtt + \"ms\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    amqpConnection.getOrCreateChannel(type, name);\n} catch (RuntimeException e) {\n    if (e.getCause() instanceof java.util.concurrent.TimeoutException) {\n        // handshake timed out; raise the timeout or retry upstream\n    }\n    throw e;\n}","preventionTips":["Set connectionTimeoutInMilliSecs comfortably above measured broker RTT.","Wire an AMQPRetryPattern so a one-off handshake timeout is retried.","Investigate sustained handshake latency as a broker-load or network problem."],"tags":["amqp","rabbitmq","connection","timeout","network"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}