Use log.warning instead of log.warn
This commit is contained in:
@@ -688,7 +688,7 @@ class Cluster(object):
|
|||||||
|
|
||||||
host.set_down()
|
host.set_down()
|
||||||
|
|
||||||
log.warn("Host %s has been marked down", host)
|
log.warning("Host %s has been marked down", host)
|
||||||
|
|
||||||
self.load_balancing_policy.on_down(host)
|
self.load_balancing_policy.on_down(host)
|
||||||
self.control_connection.on_down(host)
|
self.control_connection.on_down(host)
|
||||||
@@ -734,7 +734,7 @@ class Cluster(object):
|
|||||||
return
|
return
|
||||||
|
|
||||||
if not all(futures_results):
|
if not all(futures_results):
|
||||||
log.warn("Connection pool could not be created, not marking node %s up", host)
|
log.warning("Connection pool could not be created, not marking node %s up", host)
|
||||||
return
|
return
|
||||||
|
|
||||||
self._finalize_add(host)
|
self._finalize_add(host)
|
||||||
@@ -873,9 +873,9 @@ class Cluster(object):
|
|||||||
|
|
||||||
log.debug("Done preparing all known prepared statements against host %s", host)
|
log.debug("Done preparing all known prepared statements against host %s", host)
|
||||||
except OperationTimedOut as timeout:
|
except OperationTimedOut as timeout:
|
||||||
log.warn("Timed out trying to prepare all statements on host %s: %s", host, timeout)
|
log.warning("Timed out trying to prepare all statements on host %s: %s", host, timeout)
|
||||||
except (ConnectionException, socket.error) as exc:
|
except (ConnectionException, socket.error) as exc:
|
||||||
log.warn("Error trying to prepare all statements on host %s: %r", host, exc)
|
log.warning("Error trying to prepare all statements on host %s: %r", host, exc)
|
||||||
except Exception:
|
except Exception:
|
||||||
log.exception("Error trying to prepare all statements on host %s", host)
|
log.exception("Error trying to prepare all statements on host %s", host)
|
||||||
finally:
|
finally:
|
||||||
@@ -1233,7 +1233,7 @@ class Session(object):
|
|||||||
self.cluster.signal_connection_failure(host, conn_exc, is_host_addition)
|
self.cluster.signal_connection_failure(host, conn_exc, is_host_addition)
|
||||||
return False
|
return False
|
||||||
except Exception as conn_exc:
|
except Exception as conn_exc:
|
||||||
log.warn("Failed to create connection pool for new host %s: %s", host, conn_exc)
|
log.warning("Failed to create connection pool for new host %s: %s", host, conn_exc)
|
||||||
self.cluster.signal_connection_failure(host, conn_exc, is_host_addition)
|
self.cluster.signal_connection_failure(host, conn_exc, is_host_addition)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@@ -1428,11 +1428,11 @@ class ControlConnection(object):
|
|||||||
return self._try_connect(host)
|
return self._try_connect(host)
|
||||||
except ConnectionException as exc:
|
except ConnectionException as exc:
|
||||||
errors[host.address] = exc
|
errors[host.address] = exc
|
||||||
log.warn("[control connection] Error connecting to %s:", host, exc_info=True)
|
log.warning("[control connection] Error connecting to %s:", host, exc_info=True)
|
||||||
self._cluster.signal_connection_failure(host, exc, is_host_addition=False)
|
self._cluster.signal_connection_failure(host, exc, is_host_addition=False)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
errors[host.address] = exc
|
errors[host.address] = exc
|
||||||
log.warn("[control connection] Error connecting to %s:", host, exc_info=True)
|
log.warning("[control connection] Error connecting to %s:", host, exc_info=True)
|
||||||
|
|
||||||
raise NoHostAvailable("Unable to connect to any servers", errors)
|
raise NoHostAvailable("Unable to connect to any servers", errors)
|
||||||
|
|
||||||
@@ -1859,7 +1859,7 @@ class _Scheduler(object):
|
|||||||
def _log_if_failed(self, future):
|
def _log_if_failed(self, future):
|
||||||
exc = future.exception()
|
exc = future.exception()
|
||||||
if exc:
|
if exc:
|
||||||
log.warn(
|
log.warning(
|
||||||
"An internally scheduled tasked failed with an unhandled exception:",
|
"An internally scheduled tasked failed with an unhandled exception:",
|
||||||
exc_info=exc)
|
exc_info=exc)
|
||||||
|
|
||||||
@@ -2077,8 +2077,8 @@ class ResponseFuture(object):
|
|||||||
if self._metrics is not None:
|
if self._metrics is not None:
|
||||||
self._metrics.on_other_error()
|
self._metrics.on_other_error()
|
||||||
# need to retry against a different host here
|
# need to retry against a different host here
|
||||||
log.warn("Host %s is overloaded, retrying against a different "
|
log.warning("Host %s is overloaded, retrying against a different "
|
||||||
"host", self._current_host)
|
"host", self._current_host)
|
||||||
self._retry(reuse_connection=False, consistency_level=None)
|
self._retry(reuse_connection=False, consistency_level=None)
|
||||||
return
|
return
|
||||||
elif isinstance(response, IsBootstrappingErrorMessage):
|
elif isinstance(response, IsBootstrappingErrorMessage):
|
||||||
|
|||||||
@@ -181,9 +181,9 @@ class Connection(object):
|
|||||||
try:
|
try:
|
||||||
cb(new_exc)
|
cb(new_exc)
|
||||||
except Exception:
|
except Exception:
|
||||||
log.warn("Ignoring unhandled exception while erroring callbacks for a "
|
log.warning("Ignoring unhandled exception while erroring callbacks for a "
|
||||||
"failed connection (%s) to host %s:",
|
"failed connection (%s) to host %s:",
|
||||||
id(self), self.host, exc_info=True)
|
id(self), self.host, exc_info=True)
|
||||||
|
|
||||||
def handle_pushed(self, response):
|
def handle_pushed(self, response):
|
||||||
log.debug("Message pushed from server: %r", response)
|
log.debug("Message pushed from server: %r", response)
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ def decode_response(stream_id, flags, opcode, body, decompressor=None):
|
|||||||
trace_id = None
|
trace_id = None
|
||||||
|
|
||||||
if flags:
|
if flags:
|
||||||
log.warn("Unknown protocol flags set: %02x. May cause problems.", flags)
|
log.warning("Unknown protocol flags set: %02x. May cause problems.", flags)
|
||||||
|
|
||||||
msg_class = _message_types_by_opcode[opcode]
|
msg_class = _message_types_by_opcode[opcode]
|
||||||
msg = msg_class.recv_body(body)
|
msg = msg_class.recv_body(body)
|
||||||
|
|||||||
@@ -256,8 +256,8 @@ class _HostReconnectionHandler(_ReconnectionHandler):
|
|||||||
if isinstance(exc, AuthenticationFailed):
|
if isinstance(exc, AuthenticationFailed):
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
log.warn("Error attempting to reconnect to %s, scheduling retry in %f seconds: %s",
|
log.warning("Error attempting to reconnect to %s, scheduling retry in %f seconds: %s",
|
||||||
self.host, next_delay, exc)
|
self.host, next_delay, exc)
|
||||||
log.debug("Reconnection error details", exc_info=True)
|
log.debug("Reconnection error details", exc_info=True)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@@ -368,7 +368,7 @@ class HostConnectionPool(object):
|
|||||||
try:
|
try:
|
||||||
self._add_conn_if_under_max()
|
self._add_conn_if_under_max()
|
||||||
except (ConnectionException, socket.error) as exc:
|
except (ConnectionException, socket.error) as exc:
|
||||||
log.warn("Failed to create new connection to %s: %s", self.host, exc)
|
log.warning("Failed to create new connection to %s: %s", self.host, exc)
|
||||||
except Exception:
|
except Exception:
|
||||||
log.exception("Unexpectedly failed to create new connection")
|
log.exception("Unexpectedly failed to create new connection")
|
||||||
finally:
|
finally:
|
||||||
@@ -400,7 +400,7 @@ class HostConnectionPool(object):
|
|||||||
self._signal_available_conn()
|
self._signal_available_conn()
|
||||||
return True
|
return True
|
||||||
except (ConnectionException, socket.error) as exc:
|
except (ConnectionException, socket.error) as exc:
|
||||||
log.warn("Failed to add new connection to pool for host %s: %s", self.host, exc)
|
log.warning("Failed to add new connection to pool for host %s: %s", self.host, exc)
|
||||||
with self._lock:
|
with self._lock:
|
||||||
self.open_count -= 1
|
self.open_count -= 1
|
||||||
if self._session.cluster.signal_connection_failure(self.host, exc, is_host_addition=False):
|
if self._session.cluster.signal_connection_failure(self.host, exc, is_host_addition=False):
|
||||||
|
|||||||
Reference in New Issue
Block a user