From ea6209db5749c2456ef7ec7b0b0fc897733ff640 Mon Sep 17 00:00:00 2001 From: Tyler Hobbs Date: Thu, 24 Apr 2014 15:21:42 -0500 Subject: [PATCH] Don't log at ERROR when a conn closes during startup --- CHANGELOG.rst | 5 +++++ cassandra/connection.py | 3 +++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c53c6731..04c30069 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,6 +11,11 @@ Bug Fixes * Avoid handling a node coming up multiple times due to a reconnection attempt succeeding close to the same time that an UP notification is pushed +Other +----- +* Don't log at ERROR when a connection is closed during the startup + communications + 1.1.1 ===== April 16, 2014 diff --git a/cassandra/connection.py b/cassandra/connection.py index 79c04605..153015a7 100644 --- a/cassandra/connection.py +++ b/cassandra/connection.py @@ -415,6 +415,9 @@ class Connection(object): raise ConnectionException( "Failed to initialize new connection to %s: %s" % (self.host, startup_response.summary_msg())) + elif isinstance(startup_response, ConnectionShutdown): + log.debug("Connection to %s was closed during the startup handshake", (self.host)) + raise startup_response else: msg = "Unexpected response during Connection setup: %r" log.error(msg, startup_response)