Skip to content

fix: migrate to correct logger interface #4605

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions coordinator/gscoordinator/flex/core/alert/alert_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ def _try_to_recover_from_disk(self):
with open(self._receiver_path, "rb") as f:
self._receivers = pickle.load(f)
except Exception as e:
logger.warn("Failed to recover alert receiver: %s", str(e))
logger.warning("Failed to recover alert receiver: %s", str(e))

def _pickle_receiver_impl(self):
try:
with open(self._receiver_path, "wb") as f:
pickle.dump(self._receivers, f)
except Exception as e:
logger.warn("Failed to dump receiver: %s", str(e))
logger.warning("Failed to dump receiver: %s", str(e))

def list_alert_rules(self) -> List[GetAlertRuleResponse]:
rlt = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,5 @@ def send(self, message: AlertMessage):
raise RuntimeError(str(rlt))

except Exception as e:
logger.warn("Failed to send dingtalk: %s", str(e))
logger.warning("Failed to send dingtalk: %s", str(e))
self._error_msg = str(e)
2 changes: 1 addition & 1 deletion coordinator/gscoordinator/flex/core/alert/builtin_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def run_alert(self):
# alert
self.alert(alert_message)
except Exception as e:
logger.warn("Failed to get disk usage: %s", str(e))
logger.warning("Failed to get disk usage: %s", str(e))


class GremlinServiceAvailableAlert(AlertRule):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def _pickle_messages_impl(self):
try:
self.dump_to_disk()
except Exception as e:
logger.warn(
logger.warning(
"Failed to dump alert message on date %s: %s",
str(self._date),
str(e),
Expand All @@ -74,7 +74,7 @@ def _try_to_recover_from_disk(self):
with open(self._pickle_path, "rb") as f:
self._messages = pickle.load(f) # noqa: B301
except Exception as e:
logger.warn(
logger.warning(
"Failed to recover alert message from path %s: %s",
self._pickle_path,
str(e),
Expand Down Expand Up @@ -151,7 +151,7 @@ def _disk_cleanup_impl(self):
os.remove(file_path)
logger.info("Clean alert file: %s", str(file_path))
except Exception as e:
logger.warn("Failed to clean the alert file: %s", str(e))
logger.warning("Failed to clean the alert file: %s", str(e))

def is_message_belongs_to_certain_day(self, message, date):
"""
Expand Down
2 changes: 1 addition & 1 deletion coordinator/gscoordinator/flex/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def _initialize_client(self, config: Config):
from gscoordinator.flex.core.insight import init_groot_client
initializer = init_groot_client
if initializer is None:
logger.warn(f"Client initializer of {SOLUTION} not found.")
logger.warning(f"Client initializer of {SOLUTION} not found.")
return None
return initializer(config)

Expand Down
2 changes: 1 addition & 1 deletion coordinator/gscoordinator/flex/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def str_to_bool(s):
try:
GROOT_PASSWORD = base64.b64decode(GROOT_PASSWORD).decode('utf-8')
except Exception as e:
logger.warn("Invalid base64-encoded string found, use original value: %s", str(e))
logger.warning("Invalid base64-encoded string found, use original value: %s", str(e))
GROOT_FRONTEND_POD_SUFFIX = os.environ.get("GROOT_FRONTEND_POD_SUFFIX", "graphscope-store-frontend")
GROOT_STORE_POD_SUFFIX = os.environ.get("GROOT_STORE_POD_SUFFIX", "graphscope-store-store")
GROOT_COORDINATOR_POD_SUFFIX = os.environ.get("GROOT_COORDINATOR_POD_SUFFIX", "graphscope-store-coordinator")
Expand Down
4 changes: 2 additions & 2 deletions coordinator/gscoordinator/flex/core/datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ def try_to_recover_from_disk(self):
with open(self._pickle_path, "rb") as f:
self._datasource_mapping = pickle.load(f)
except Exception as e:
logger.warn("Failed to recover data source mapping: %s", str(e))
logger.warning("Failed to recover data source mapping: %s", str(e))

def dump_to_disk(self):
try:
with open(self._pickle_path, "wb") as f:
pickle.dump(self._datasource_mapping, f)
except Exception as e:
logger.warn("Failed to dump data source mapping: %s", str(e))
logger.warning("Failed to dump data source mapping: %s", str(e))

def get_edge_full_label(
self,
Expand Down
6 changes: 3 additions & 3 deletions coordinator/gscoordinator/flex/core/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def _fetch_resource_usage_impl(self):
{"host": name, "timestamp": t, "usage": round(memory)}
)
except Exception as e:
logger.warn("Failed to fetch resource usage %s", str(e))
logger.warning("Failed to fetch resource usage %s", str(e))

def _fetch_status_impl(self):
try:
Expand Down Expand Up @@ -358,7 +358,7 @@ def _fetch_status_impl(self):
sorted_status[key] = status[key]
self._status["pods"] = sorted_status
except Exception as e:
logger.warn("Failed to fetch deployment status %s", str(e))
logger.warning("Failed to fetch deployment status %s", str(e))

def initialize_resource_usage(self):
try:
Expand All @@ -379,7 +379,7 @@ def initialize_resource_usage(self):
"memory_usage": queue.Queue(maxsize=720 * pod_num),
}
except Exception as e:
logger.warn("Failed to fetch resource usage %s", str(e))
logger.warning("Failed to fetch resource usage %s", str(e))
return {"cpu_usage": [], "memory_usage": []}

def get_resource_usage(self) -> dict:
Expand Down
2 changes: 1 addition & 1 deletion coordinator/gscoordinator/flex/core/insight/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def _fetch_endpoints_impl(self):
cypher_endpoint = test_cypher_endpoint(pod.status.pod_ip, GROOT_CYPHER_PORT)

except Exception as e:
logger.warn(f"Failed to fetch frontend endpoints: {str(e)}")
logger.warning(f"Failed to fetch frontend endpoints: {str(e)}")
else:
if (
gremlin_endpoint != self._endpoints["gremlin_endpoint"]
Expand Down
4 changes: 2 additions & 2 deletions coordinator/gscoordinator/flex/core/insight/groot.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _try_to_recover_from_disk(self):
self._graph, JobStatus.from_dict(status)
)
except Exception as e:
logger.warn("Failed to recover job status: %s", str(e))
logger.warning("Failed to recover job status: %s", str(e))

def _pickle_job_status_impl(self):
try:
Expand All @@ -100,7 +100,7 @@ def _pickle_job_status_impl(self):
with open(self._job_status_pickle_path, "wb") as f:
pickle.dump(status, f)
except Exception as e:
logger.warn("Pickle job status failed: %s", str(e))
logger.warning("Pickle job status failed: %s", str(e))

def _restart_pod(self, pod_name, pod_ip, port):
logger.info(f"Restart groot store pod {pod_name}, ip {pod_ip}")
Expand Down
2 changes: 1 addition & 1 deletion coordinator/gscoordinator/flex/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def get_public_ip() -> Union[str, None]:
else:
return None
except requests.exceptions.RequestException as e:
logger.warn("Failed to get public ip: %s", str(e))
logger.warning("Failed to get public ip: %s", str(e))
return None


Expand Down