check and correct thread_stack_size
parent
1854683ddd
commit
5c6cff1ea3
|
|
@ -197,7 +197,7 @@ struct fast_task_info *alloc_channel_task(IdempotencyClientChannel *channel,
|
||||||
channel->in_ioevent = 1;
|
channel->in_ioevent = 1;
|
||||||
channel->last_connect_time = g_current_time;
|
channel->last_connect_time = g_current_time;
|
||||||
if ((*err_no=sf_nio_notify(task, SF_NIO_STAGE_CONNECT)) != 0) {
|
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);
|
free_queue_push(task);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
#include "fastcommon/sockopt.h"
|
#include "fastcommon/sockopt.h"
|
||||||
|
|
||||||
#define SF_DEF_THREAD_STACK_SIZE (64 * 1024)
|
#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_MAX_PACKAGE_SIZE (64 * 1024)
|
||||||
#define SF_DEF_MIN_BUFF_SIZE (64 * 1024)
|
#define SF_DEF_MIN_BUFF_SIZE (64 * 1024)
|
||||||
#define SF_DEF_MAX_BUFF_SIZE (64 * 1024)
|
#define SF_DEF_MAX_BUFF_SIZE (64 * 1024)
|
||||||
|
|
|
||||||
|
|
@ -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;
|
g_sf_global_vars.sync_log_buff_interval = SYNC_LOG_BUFF_DEF_INTERVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pThreadStackSize = iniGetStrValue(ini_ctx->section_name,
|
pThreadStackSize = iniGetStrValueEx(ini_ctx->section_name,
|
||||||
"thread_stack_size", ini_ctx->context);
|
"thread_stack_size", ini_ctx->context, true);
|
||||||
if (pThreadStackSize == NULL) {
|
if (pThreadStackSize == NULL) {
|
||||||
thread_stack_size = SF_DEF_THREAD_STACK_SIZE;
|
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)
|
&thread_stack_size)) != 0)
|
||||||
{
|
{
|
||||||
return result;
|
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;
|
g_sf_global_vars.thread_stack_size = (int)thread_stack_size;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue