Skip to content

Commit

Permalink
Merge branch 'feature_patch_432_core' into '4_3_2_release'
Browse files Browse the repository at this point in the history
  • Loading branch information
obdev authored and ob-robot committed Oct 21, 2024
1 parent 2f32144 commit bc486e6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/obproxy/ob_proxy_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,7 @@ void ObProxyMain::sig_direct_handler(const int sig)
if (info.need_conn_accept_) {
info.disable_net_accept(); // disable accecpt new connection
}
MEM_BARRIER();
info.graceful_exit_start_time_ = get_hrtime_internal();
info.graceful_exit_end_time_ = HRTIME_USECONDS(get_global_proxy_config().hot_upgrade_exit_timeout)
+ info.graceful_exit_start_time_;
Expand Down Expand Up @@ -925,10 +926,17 @@ void ObProxyMain::sig_direct_handler(const int sig)
LOG_INFO("gcov flush now");
__gcov_flush();
#endif
LOG_INFO("recv signal, will graceful exit", K(sig), K(info));
info.received_sig_ = sig;
if (info.need_conn_accept_) {
info.disable_net_accept(); // disable accecpt new connection
}
// 1. disable_net_accept will call pthread_kill() to accept thread
// 2. when graceful_exit_start_time_ is changed, ObInactivityCop::check_inactivity
// call pthread_cancel() and pthread_join() to accept thread
// - to avoid complex parallel multi-thread status and a lower-probability core problem (2024062100102854439),
// need use MEM_BARRIER to restrict pthread_kill() happens before pthread_cancel()
MEM_BARRIER();
info.graceful_exit_start_time_ = get_hrtime_internal();
info.graceful_exit_end_time_ = HRTIME_USECONDS(get_global_proxy_config().delay_exit_time)
+ info.graceful_exit_start_time_;
Expand Down
4 changes: 4 additions & 0 deletions src/obproxy/obutils/ob_hot_upgrade_processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,7 @@ int ObHotUpgradeProcessor::state_wait_hu_cmd(const ObProxyServerInfo &proxy_info
}
if (OB_SUCC(ret) || info_.is_local_exit()) {
info_.disable_net_accept();
MEM_BARRIER();
info_.is_parent_ = true;// move to parent site, no mater on which site before
info_.update_parent_status(HU_STATUS_DO_QUICK_EXIT);
info_.graceful_exit_start_time_ = get_hrtime_internal();
Expand Down Expand Up @@ -942,6 +943,7 @@ int ObHotUpgradeProcessor::state_parent_wait_cr_cmd(const ObProxyServerInfo &pro
//4. cancel timeout_rollback

info_.disable_net_accept();
MEM_BARRIER();
info_.graceful_exit_start_time_ = get_hrtime_internal();
info_.graceful_exit_end_time_ = HRTIME_USECONDS(get_global_proxy_config().hot_upgrade_exit_timeout)
+ info_.graceful_exit_start_time_;// nanosecond
Expand Down Expand Up @@ -1090,6 +1092,7 @@ int ObHotUpgradeProcessor::state_sub_wait_cr_cmd()
//4. cancel timeout_rollback job

info_.disable_net_accept();
MEM_BARRIER();
info_.graceful_exit_start_time_ = get_hrtime_internal();
info_.graceful_exit_end_time_ = HRTIME_USECONDS(get_global_proxy_config().hot_upgrade_exit_timeout)
+ info_.graceful_exit_start_time_; // nanosecond
Expand Down Expand Up @@ -1746,6 +1749,7 @@ int ObHotUpgradeProcessor::do_hot_upgrade_work()
}
case HUC_LOCAL_EXIT: {
info_.disable_net_accept();
MEM_BARRIER();
info_.graceful_exit_start_time_ = get_hrtime_internal();
info_.graceful_exit_end_time_ = HRTIME_USECONDS(get_global_proxy_config().delay_exit_time)
+ info_.graceful_exit_start_time_; // nanosecond
Expand Down

0 comments on commit bc486e6

Please sign in to comment.