Skip to content

Commit

Permalink
Merge pull request #265 from wayyoungboy/2.2.0-qulei
Browse files Browse the repository at this point in the history
print traceback
  • Loading branch information
wayyoungboy authored Jun 19, 2024
2 parents 5123a01 + 581e206 commit 8f3464a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 3 additions & 1 deletion core.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from __future__ import absolute_import, division, print_function

import os
import traceback
from optparse import Values
from copy import copy

Expand Down Expand Up @@ -319,7 +320,8 @@ def rca_run(self, opts):
handler.handle()
handler.execute()
except Exception as e:
self.stdio.error(e)
self.stdio.error("rca run Exception: {0}".format(e))
self.stdio.verbose(traceback.format_exc())

def rca_list(self, opts):
config = self.config_manager
Expand Down
9 changes: 7 additions & 2 deletions handler/checker/check_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import os
import queue
import time
import traceback

import yaml

Expand Down Expand Up @@ -168,11 +168,15 @@ def handle(self):
new_tasks[task_name] = task_value
self.tasks = new_tasks
self.stdio.verbose("tasks is {0}".format(self.tasks.keys()))
return True
except Exception as e:
self.stdio.error(e)
self.stdio.error("Get package tasks failed. Error info is {0}".format(e))
self.stdio.verbose(traceback.format_exc())
return False

# get all tasks
def get_all_tasks(self):
self.stdio.verbose("get all tasks")
current_path = self.tasks_base_path
tasks = {}
for root, dirs, files in os.walk(current_path):
Expand Down Expand Up @@ -239,6 +243,7 @@ def execute(self):
self.stdio.error("Report error :{0}".format(e))
except Exception as e:
self.stdio.error("Internal error :{0}".format(e))
self.stdio.verbose(traceback.format_exc())


class checkOBConnectorPool:
Expand Down
5 changes: 3 additions & 2 deletions handler/rca/scene/ddl_disk_full_scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
@file: ddl_disk_full_scene.py
@desc:
"""
import re

from handler.rca.rca_exception import RCAInitException, RCAExecuteException
from handler.rca.rca_handler import RcaScene, RCA_ResultRecord
from handler.rca.rca_handler import RcaScene
from common.tool import StringUtils


Expand Down Expand Up @@ -108,12 +107,14 @@ def execute(self):
## if the action is not add_index
# 获取各个节点上的源表大小,单位为B
# self.stdio._call_stdio('start_loading', 'gstart query estimated_data_size, please wait some minutes...')
self.stdio.start_loading('start query estimated_data_size, please wait some minutes...')
sql = "select svr_ip, svr_port, sum(original_size) as estimated_data_size from oceanbase.__all_virtual_tablet_sstable_macro_info where tablet_id in (select tablet_id from oceanbase.__all_virtual_tablet_to_table_history where table_id = {0}) and (svr_ip, svr_port) in (select svr_ip, svr_port from oceanbase.__all_virtual_ls_meta_table where role = 1) group by svr_ip, svr_port;".format(
self.table_id
)
self.verbose("execute_sql is {0}".format(sql))
tablet_size_data = self.ob_connector.execute_sql_return_cursor_dictionary(sql).fetchall()
# self.stdio._call_stdio('stop_loading', 'succeed')
self.stdio.stop_loading('succeed')
for item in tablet_size_data:
tablet_size_data_ip = item["svr_ip"]
tablet_size_data_port = item["svr_port"]
Expand Down

0 comments on commit 8f3464a

Please sign in to comment.