Skip to content

Commit

Permalink
Compatibility for non UTF-8 encoding in obproxy logs in disconnected…
Browse files Browse the repository at this point in the history
… scenarios (#662)
  • Loading branch information
wayyoungboy authored Jan 2, 2025
1 parent 4f99a45 commit d599500
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/rca/disconnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def __execute_obproxy_one_node(self, node):
if parses_number >= self.max_parses_number:
break
self.stdio.verbose("read the log file: {0}".format(name))
with open(name, 'r') as f:
with open(name, 'r', errors='ignore') as f:
log_list = f.read().strip().split('\n')
for line in log_list:
try:
Expand Down Expand Up @@ -153,7 +153,7 @@ def __init__(self, context, log, record):
for log_name in logs_name:
if observer_trace_id != "Y0-0000000000000000-0-0":
break
with open(log_name, 'r') as f:
with open(log_name, 'r', errors='ignore') as f:
log_list = f.read().strip().split('\n')
for line in log_list:
if "session_id:" in line and "trace_id:" in line:
Expand Down

0 comments on commit d599500

Please sign in to comment.