Skip to content

Commit

Permalink
fix some type err
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoleizi2016 committed Dec 26, 2023
1 parent f614146 commit 8c18ec4
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
5 changes: 2 additions & 3 deletions src/obproxy/dbconfig/ob_proxy_pb_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,8 @@ int ObProxyPbUtils::do_parse_json_rules(Value *json_root, ObProxyShardRuleList &
DLIST_FOREACH(it, json_root->get_array()) {
rule.reset();
if (JT_STRING == it->get_type()) {
if (OB_FAIL(force_parse_groovy(it->get_string(), rule, allocator))) {
LOG_WARN("fail to pare groovy", K(ret));
} else if (rule.is_valid()) {
force_parse_groovy(it->get_string(), rule, allocator);
if (rule.is_valid()) {
rule_list.push_back(rule);
}
}
Expand Down
20 changes: 10 additions & 10 deletions src/obproxy/ob_proxy_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ int ObProxyMain::init_signal()
LOG_WARN("fail to add_sig_direct_catched", K(ret));
} else if (OB_FAIL(add_sig_direct_catched(action, SIGUSR2))) {
LOG_WARN("fail to add_sig_direct_catched", K(ret));
} else if (OB_FAIL(add_sig_direct_catched(action, 43))) {
} else if (OB_FAIL(add_sig_direct_catched(action, SIG_KILL_THREAD))) {
LOG_WARN("fail to add_sig_direct_catched", K(ret));

// when a process terminates, the SIGHUP signal can be catch by its sub process
Expand All @@ -623,13 +623,13 @@ int ObProxyMain::init_signal()
} else if (OB_FAIL(add_sig_async_catched(action, SIGCHLD))) {
LOG_WARN("fail to add_sig_async_catched", K(ret));

} else if (OB_FAIL(add_sig_async_catched(action, 40))) {
} else if (OB_FAIL(add_sig_async_catched(action, SIG_CHECK_FILE))) {
LOG_WARN("fail to add_sig_async_catched", K(ret));
} else if (OB_FAIL(add_sig_async_catched(action, 41))) {
} else if (OB_FAIL(add_sig_async_catched(action, SIG_DOWN_LOG_LEV))) {
LOG_WARN("fail to add_sig_async_catched", K(ret));
} else if (OB_FAIL(add_sig_async_catched(action, 42))) {
} else if (OB_FAIL(add_sig_async_catched(action, SIG_UP_LOG_LEV))) {
LOG_WARN("fail to add_sig_async_catched", K(ret));
} else if (OB_FAIL(add_sig_async_catched(action, 49))) {
} else if (OB_FAIL(add_sig_async_catched(action, SIG_PRINT_MEM_USAGE))) {
LOG_WARN("fail to add_sig_async_catched", K(ret));
} else {
LOG_DEBUG("succ to init_signal");
Expand Down Expand Up @@ -797,18 +797,18 @@ int ObProxyMain::do_detect_sig()
}
break;
}
case 40: {
case SIG_CHECK_FILE: {
OB_LOGGER.check_file();
break;
}
case 41:
case 42: {
const bool level_flag = (41 == sig) ? false : true;
case SIG_DOWN_LOG_LEV:
case SIG_UP_LOG_LEV: {
const bool level_flag = (SIG_DOWN_LOG_LEV == sig) ? false : true;
get_global_proxy_config().update_log_level(level_flag);
LOG_INFO("now:", K(OB_LOGGER.get_level_str()));
break;
}
case 49: { // for print memory usage
case SIG_PRINT_MEM_USAGE: { // for print memory usage
ObProxyMain::print_memory_usage();
ObMemoryResourceTracker::dump();
break;
Expand Down
2 changes: 1 addition & 1 deletion src/obproxy/obutils/ob_proxy_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ class ObProxyConfig : public common::ObCommonConfig
DEF_BOOL(auto_scan_all, "false", "if enabled, need scan all", CFG_NO_NEED_REBOOT, CFG_SECTION_OBPROXY, CFG_VISIBLE_LEVEL_USER);

// session pool
DEF_BOOL(is_pool_mode, "false", "if enabled means useing session pool", CFG_NO_NEED_REBOOT, CFG_SECTION_OBPROXY, CFG_VISIBLE_LEVEL_USER);
DEF_BOOL(is_pool_mode, "false", "if enabled means using session pool", CFG_NO_NEED_REBOOT, CFG_SECTION_OBPROXY, CFG_VISIBLE_LEVEL_USER);
DEF_BOOL(enable_conn_precreate, "false", "if enabled means precreate conn for session pool", CFG_NO_NEED_REBOOT, CFG_SECTION_OBPROXY, CFG_VISIBLE_LEVEL_USER);
DEF_BOOL(enable_session_pool_for_no_sharding, "false", "if enabled can use session pool for no sharding", CFG_NO_NEED_REBOOT, CFG_SECTION_OBPROXY, CFG_VISIBLE_LEVEL_USER);
DEF_BOOL(enable_no_sharding_skip_real_conn, "false", "if enabled no sharding will use saved password check to skip real conn", CFG_NO_NEED_REBOOT, CFG_SECTION_OBPROXY, CFG_VISIBLE_LEVEL_USER);
Expand Down
2 changes: 1 addition & 1 deletion src/obproxy/proxy/mysql/ob_mysql_sm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ int ObMysqlSM::state_client_request_read(int event, void *data)
client_session_->active_ = true;
MYSQL_INCREMENT_DYN_STAT(CURRENT_ACTIVE_CLIENT_CONNECTIONS);
}
// do not warry about cluster resource, large request will allways behind
// do not warry about cluster resource, large request will always behind
// the auth request.

call_transact_and_set_next_state(ObMysqlTransact::modify_request);
Expand Down
2 changes: 1 addition & 1 deletion src/obproxy/proxy/mysqllib/ob_mysql_request_analyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ inline int ObMysqlRequestAnalyzer::handle_auth_request(ObIOBufferReader &reader,
}
} else {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("it shoulde not happened", K(ret));
LOG_WARN("it should not happened", K(ret));
}
return ret;
}
Expand Down
2 changes: 1 addition & 1 deletion src/obproxy/utils/ob_proxy_hot_upgrader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ void ObHotUpgraderInfo::disable_net_accept()
for (int64_t i = 0; i < g_event_processor.dedicate_thread_count_; ++i) {
if (DEDICATE_THREAD_ACCEPT == g_event_processor.all_dedicate_threads_[i]->get_dedicate_type()) {
tid = g_event_processor.all_dedicate_threads_[i]->tid_;
if (OB_FAIL(thread_kill(tid, 43))) {
if (OB_FAIL(thread_kill(tid, SIG_KILL_THREAD))) {
LOG_WARN("fail to do thread_kill", K(tid), K(ret));
}
}
Expand Down

0 comments on commit 8c18ec4

Please sign in to comment.