From e2839023abfa319df715496604286d1d9362b7dc Mon Sep 17 00:00:00 2001 From: wangbin579 Date: Tue, 31 Jul 2018 14:28:48 +0800 Subject: [PATCH] Remove reconfigure,etc and limit show connectionlist num --- plugins/admin/admin-commands.c | 7 +++++- src/cetus-process-cycle.c | 43 ---------------------------------- src/cetus-process-cycle.h | 6 ----- src/cetus-process.c | 8 ------- 4 files changed, 6 insertions(+), 58 deletions(-) diff --git a/plugins/admin/admin-commands.c b/plugins/admin/admin-commands.c index 24e564d..0671a7d 100644 --- a/plugins/admin/admin-commands.c +++ b/plugins/admin/admin-commands.c @@ -406,8 +406,13 @@ void admin_show_connectionlist(network_mysqld_con *admin_con, int show_count) return; } - int number = show_count==-1 ? 65536 : show_count; + int number = 256; + if (show_count > 0) { + if (show_count < 256) { + number = show_count; + } + } chassis *chas = admin_con->srv; chassis_private *priv = chas->priv; chassis_plugin_config *config = admin_con->config; diff --git a/src/cetus-process-cycle.c b/src/cetus-process-cycle.c index 9c2cc4b..4c1317f 100644 --- a/src/cetus-process-cycle.c +++ b/src/cetus-process-cycle.c @@ -33,18 +33,11 @@ cetus_pid_t cetus_parent; cetus_pid_t cetus_new_binary; sig_atomic_t cetus_reap; -sig_atomic_t cetus_sigio; -sig_atomic_t cetus_sigalrm; sig_atomic_t cetus_terminate; sig_atomic_t cetus_quit; unsigned int cetus_exiting; -sig_atomic_t cetus_reconfigure; -sig_atomic_t cetus_reopen; sig_atomic_t cetus_change_binary; -unsigned int cetus_inherited; -unsigned int cetus_daemonized; - sig_atomic_t cetus_noaccept; unsigned int cetus_restart; @@ -116,12 +109,6 @@ cetus_master_process_cycle(cetus_cycle_t *cycle) struct itimerval itv; unsigned int live; - - if (cycle->daemon_mode) { - cetus_daemonized = 1; - } - - cetus_start_worker_processes(cycle, cycle->worker_processes, CETUS_PROCESS_RESPAWN); @@ -169,24 +156,6 @@ cetus_master_process_cycle(cetus_cycle_t *cycle) continue; } - if (cetus_reconfigure) { - cetus_reconfigure = 0; - - g_message("%s: reconfiguring", G_STRLOC); - - /* init cycle */ - cetus_start_worker_processes(cycle, cycle->worker_processes, - CETUS_PROCESS_JUST_RESPAWN); - open_admin(cycle); - - /* allow new processes to start */ - usleep(100 * 1000); - - live = 1; - cetus_signal_worker_processes(cycle, - cetus_signal_value(CETUS_SHUTDOWN_SIGNAL)); - } - if (cetus_restart) { cetus_restart = 0; cetus_start_worker_processes(cycle, cycle->worker_processes, @@ -196,12 +165,6 @@ cetus_master_process_cycle(cetus_cycle_t *cycle) live = 1; } - if (cetus_reopen) { - cetus_reopen = 0; - g_message("%s: reopening logs", G_STRLOC); - cetus_signal_worker_processes(cycle, - cetus_signal_value(CETUS_REOPEN_SIGNAL)); - } if (cetus_change_binary) { g_message("%s: changing binary", G_STRLOC); @@ -581,11 +544,6 @@ cetus_worker_process_cycle(cetus_cycle_t *cycle, void *data) /* Call cetus shut down */ } } - - if (cetus_reopen) { - cetus_reopen = 0; - g_message("%s: reopening logs", G_STRLOC); - } } } @@ -798,7 +756,6 @@ cetus_channel_handler(int fd, short events, void *user_data) break; case CETUS_CMD_REOPEN: - cetus_reopen = 1; break; case CETUS_CMD_OPEN_CHANNEL: diff --git a/src/cetus-process-cycle.h b/src/cetus-process-cycle.h index 66d1324..c089386 100644 --- a/src/cetus-process-cycle.h +++ b/src/cetus-process-cycle.h @@ -22,18 +22,12 @@ extern unsigned int cetus_process; extern unsigned int cetus_worker; extern pid_t cetus_pid; extern pid_t cetus_new_binary; -extern unsigned int cetus_inherited; -extern unsigned int cetus_daemonized; extern unsigned int cetus_exiting; extern sig_atomic_t cetus_reap; -extern sig_atomic_t cetus_sigio; -extern sig_atomic_t cetus_sigalrm; extern sig_atomic_t cetus_quit; extern sig_atomic_t cetus_terminate; extern sig_atomic_t cetus_noaccept; -extern sig_atomic_t cetus_reconfigure; -extern sig_atomic_t cetus_reopen; extern sig_atomic_t cetus_change_binary; diff --git a/src/cetus-process.c b/src/cetus-process.c index 452ac58..d9c133e 100644 --- a/src/cetus-process.c +++ b/src/cetus-process.c @@ -371,21 +371,15 @@ cetus_signal_handler(int signo, siginfo_t *siginfo, void *ucontext) break; case cetus_signal_value(CETUS_RECONFIGURE_SIGNAL): - cetus_reconfigure = 1; - action = ", reconfiguring"; break; case cetus_signal_value(CETUS_REOPEN_SIGNAL): - cetus_reopen = 1; - action = ", reopening logs"; break; case SIGALRM: - cetus_sigalrm = 1; break; case SIGIO: - cetus_sigio = 1; break; case SIGCHLD: @@ -414,8 +408,6 @@ cetus_signal_handler(int signo, siginfo_t *siginfo, void *ucontext) break; case cetus_signal_value(CETUS_REOPEN_SIGNAL): - cetus_reopen = 1; - action = ", reopening logs"; break; case cetus_signal_value(CETUS_RECONFIGURE_SIGNAL):