Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change is_open function's log level messages from error to debug. #722

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions medusa/cassandra_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -819,17 +819,18 @@ def is_open(host, port):
# If cassandra is not running but the host is up, host may choose to silently drop inbound connections to the
# closed port or may respond with a RST indicating that the connection was refused.
# ConnectionRefusedError: [Errno 111] Connection refused
except ConnectionRefusedError as cre:
logging.error("Host '{host}' is up, but port '{port}' is closed.".format(host=host, port=port), exc_info=cre)
except socket.error as e:
logging.error("Could not open socket to port '{port}' on '{host}'.".format(host=host, port=port), exc_info=e)
except ConnectionRefusedError:
logging.debug("Port '{port}' is closed, assuming '{host}' is down.".format(host=host, port=port))
except socket.error:
logging.debug("Could not open socket to port '{port}' on '{host}'. Assuming host is down."
.format(host=host, port=port))
finally:
try:
if s:
s.close()
except os.error as ose:
logging.warning('Socket used for Port {} check failed to close for host {}'.format(port, host),
exc_info=ose)
except os.error:
logging.debug("Socket used for Port '{port}' check failed to close for host '{host}'. Assuming host is down"
.format(host=host, port=port))
return is_accessible


Expand Down
Loading