check and correct thread_stack_size

connection_manager
YuQing 2020-10-20 20:40:55 +08:00
parent 1854683ddd
commit 5c6cff1ea3
3 changed files with 10 additions and 5 deletions

View File

@ -197,7 +197,7 @@ struct fast_task_info *alloc_channel_task(IdempotencyClientChannel *channel,
channel->in_ioevent = 1;
channel->last_connect_time = g_current_time;
if ((*err_no=sf_nio_notify(task, SF_NIO_STAGE_CONNECT)) != 0) {
channel->in_ioevent = 0;
channel->in_ioevent = 0; //rollback
free_queue_push(task);
return NULL;
}

View File

@ -21,6 +21,7 @@
#include "fastcommon/sockopt.h"
#define SF_DEF_THREAD_STACK_SIZE (64 * 1024)
#define SF_MIN_THREAD_STACK_SIZE (64 * 1024)
#define SF_DEF_MAX_PACKAGE_SIZE (64 * 1024)
#define SF_DEF_MIN_BUFF_SIZE (64 * 1024)
#define SF_DEF_MAX_BUFF_SIZE (64 * 1024)

View File

@ -267,15 +267,19 @@ int sf_load_global_config_ex(const char *server_name,
g_sf_global_vars.sync_log_buff_interval = SYNC_LOG_BUFF_DEF_INTERVAL;
}
pThreadStackSize = iniGetStrValue(ini_ctx->section_name,
"thread_stack_size", ini_ctx->context);
pThreadStackSize = iniGetStrValueEx(ini_ctx->section_name,
"thread_stack_size", ini_ctx->context, true);
if (pThreadStackSize == NULL) {
thread_stack_size = SF_DEF_THREAD_STACK_SIZE;
}
else if ((result=parse_bytes(pThreadStackSize, 1,
} else if ((result=parse_bytes(pThreadStackSize, 1,
&thread_stack_size)) != 0)
{
return result;
} else if (thread_stack_size < SF_MIN_THREAD_STACK_SIZE) {
logWarning("file: "__FILE__", line: %d, "
"thread_stack_size : %d is too small, set to %d",
__LINE__, (int)thread_stack_size, SF_MIN_THREAD_STACK_SIZE);
thread_stack_size = SF_MIN_THREAD_STACK_SIZE;
}
g_sf_global_vars.thread_stack_size = (int)thread_stack_size;