From: Sage Weil Date: Thu, 18 Nov 2021 13:34:13 +0000 (-0600) Subject: mgr/cephadm: make logging about agent less verbose X-Git-Tag: v17.1.0~363^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=069cd231b9f01182200210a9227bb6ae2667e288;p=ceph-ci.git mgr/cephadm: make logging about agent less verbose Info should be things a user (not developer) cares about. Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/cephadm/agent.py b/src/pybind/mgr/cephadm/agent.py index 624c3b20154..e1191e44930 100644 --- a/src/pybind/mgr/cephadm/agent.py +++ b/src/pybind/mgr/cephadm/agent.py @@ -80,9 +80,9 @@ class CherryPyThread(threading.Thread): root_conf = {'/': {'request.dispatch': cherrypy.dispatch.MethodDispatcher(), 'tools.response_headers.on': True}} cherrypy.tree.mount(Root(self.mgr), '/', root_conf) - self.mgr.log.info('Starting cherrypy engine...') + self.mgr.log.debug('Starting cherrypy engine...') self.start_engine() - self.mgr.log.info('Cherrypy engine started.') + self.mgr.log.debug('Cherrypy engine started.') agents_down = [] for h in self.mgr.cache.get_hosts(): if self.mgr.agent_helpers._check_agent(h): @@ -92,7 +92,7 @@ class CherryPyThread(threading.Thread): self.cherrypy_shutdown_event.wait() self.cherrypy_shutdown_event.clear() cherrypy.engine.stop() - self.mgr.log.info('Cherrypy engine stopped.') + self.mgr.log.debug('Cherrypy engine stopped.') except Exception as e: self.mgr.log.error(f'Failed to run cephadm cherrypy endpoint: {e}') @@ -101,10 +101,10 @@ class CherryPyThread(threading.Thread): while port_connect_attempts < 150: try: cherrypy.engine.start() - self.mgr.log.info(f'Cephadm endpoint connected to port {self.server_port}') + self.mgr.log.debug(f'Cephadm endpoint connected to port {self.server_port}') return except cherrypy.process.wspbus.ChannelFailures as e: - self.mgr.log.info( + self.mgr.log.debug( f'{e}. Trying next port.') self.server_port += 1 cherrypy.server.httpserver = None @@ -116,7 +116,7 @@ class CherryPyThread(threading.Thread): 'Cephadm Endpoint could not find free port in range 7150-7300 and failed to start') def shutdown(self) -> None: - self.mgr.log.info('Stopping cherrypy engine...') + self.mgr.log.debug('Stopping cherrypy engine...') self.cherrypy_shutdown_event.set() @@ -220,7 +220,7 @@ class HostData: # we got old counter value with message, inform agent of new timestamp if not self.mgr.cache.messaging_agent(host): self.mgr.agent_helpers._request_agent_acks({host}) - self.mgr.log.info( + self.mgr.log.debug( f'Received old metadata from agent on host {host}. Requested up-to-date metadata.') if 'ls' in data and data['ls']: @@ -238,7 +238,7 @@ class HostData: error_daemons_old != set([dd.name() for dd in self.mgr.cache.get_error_daemons()]) or daemon_count_old != len(self.mgr.cache.get_daemons_by_host(host)) ): - self.mgr.log.info( + self.mgr.log.debug( f'Change detected in state of daemons from {host} agent metadata. Kicking serve loop') self.mgr._kick_serve_loop() @@ -246,10 +246,10 @@ class HostData: was_out_of_date = not self.mgr.cache.all_host_metadata_up_to_date() self.mgr.cache.metadata_up_to_date[host] = True if was_out_of_date and self.mgr.cache.all_host_metadata_up_to_date(): - self.mgr.log.info( + self.mgr.log.debug( 'New metadata from agent has made all hosts up to date. Kicking serve loop') self.mgr._kick_serve_loop() - self.mgr.log.info( + self.mgr.log.debug( f'Received up-to-date metadata from agent on host {host}.') except Exception as e: @@ -267,7 +267,7 @@ class AgentMessageThread(threading.Thread): super(AgentMessageThread, self).__init__(target=self.run) def run(self) -> None: - self.mgr.log.info(f'Sending message to agent on host {self.host}') + self.mgr.log.debug(f'Sending message to agent on host {self.host}') self.mgr.cache.sending_agent_message[self.host] = True try: assert self.mgr.cherrypy_thread @@ -316,7 +316,7 @@ class AgentMessageThread(threading.Thread): msg = (bytes_len + self.data) secure_agent_socket.sendall(msg.encode('utf-8')) agent_response = secure_agent_socket.recv(1024).decode() - self.mgr.log.info(f'Received "{agent_response}" from agent on host {self.host}') + self.mgr.log.debug(f'Received "{agent_response}" from agent on host {self.host}') self.mgr.cache.sending_agent_message[self.host] = False return except ConnectionError as e: