关闭 watchdog 检测 worker thread 状态的 debug 日志; 增加 usage() 显示帮助信息
This commit is contained in:
@@ -234,7 +234,7 @@ static void __dummy_event_handler(evutil_socket_t fd, short what, void * arg)
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||
ATOMIC_SET(&(ctx->lastime), now.tv_sec);
|
||||
TFE_LOG_DEBUG(g_default_logger, "Worker thread %d Update time %lds", ctx->thread_id, now.tv_sec);
|
||||
// TFE_LOG_DEBUG(g_default_logger, "Worker thread %d Update time %lds", ctx->thread_id, now.tv_sec);
|
||||
|
||||
while (ATOMIC_READ(&(ctx->proxy->make_work_thread_sleep)) > 0)
|
||||
{
|
||||
@@ -526,6 +526,17 @@ void tfe_proxy_acceptor_init(struct tfe_proxy * proxy, const char * profile)
|
||||
return;
|
||||
}
|
||||
|
||||
static void usage(char *cmd)
|
||||
{
|
||||
fprintf(stderr, "USAGE: %s [OPTIONS]\n", cmd);
|
||||
fprintf(stderr, " -v -- show version\n");
|
||||
fprintf(stderr, " -g -- generate coredump\n");
|
||||
fprintf(stderr, " -h -- show help info\n\n");
|
||||
fprintf(stderr, "kill -s SIGHUP $pid -- reload zlog configure\n");
|
||||
fprintf(stderr, "kill -s SIGUSR1 $pid -- make worker thread sleep\n");
|
||||
fprintf(stderr, "kill -s SIGUSR2 $pid -- wake worker thread form sleep\n");
|
||||
}
|
||||
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
const char * main_profile = "./conf/tfe/tfe.conf";
|
||||
@@ -536,21 +547,21 @@ int main(int argc, char * argv[])
|
||||
int opt = 0;
|
||||
bool to_generate_a_segv = false;
|
||||
|
||||
while ((opt = getopt(argc, argv, "vg")) != -1)
|
||||
while ((opt = getopt(argc, argv, "vgh")) != -1)
|
||||
{
|
||||
switch (opt)
|
||||
{
|
||||
case 'v':
|
||||
fprintf(stderr, "Tango Frontend Engine, Version: %s\n", tfe_version());
|
||||
return 0;
|
||||
|
||||
case 'g':
|
||||
fprintf(stderr, "Tango Frontend Engine, prepare to generate a coredump.");
|
||||
to_generate_a_segv = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
case 'h': /* fall through */
|
||||
default:
|
||||
usage(argv[0]);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@ static void health_check_for_thread_worker(evutil_socket_t fd, short what, void
|
||||
TFE_LOG_ERROR(g_default_logger, "Watchdog thread nowtime %ld, Worker thread %d lastime %ld, Worker thread no reply, Exit ! ! ! ", now.tv_sec, proxy->work_threads[i]->thread_id, temp);
|
||||
exit(-1);
|
||||
}
|
||||
TFE_LOG_DEBUG(g_default_logger, "Watchdog thread nowtime %ld, Worker thread %d lastime %lds ", now.tv_sec, proxy->work_threads[i]->thread_id, temp);
|
||||
// TFE_LOG_DEBUG(g_default_logger, "Watchdog thread nowtime %ld, Worker thread %d lastime %lds ", now.tv_sec, proxy->work_threads[i]->thread_id, temp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user