change some log format
This commit is contained in:
parent
a9d19f83bf
commit
59bf910719
|
@ -129,7 +129,7 @@ int32_t tsMnodeEqualVnodeNum = 4;
|
||||||
int32_t tsEnableHttpModule = 1;
|
int32_t tsEnableHttpModule = 1;
|
||||||
int32_t tsRestRowLimit = 10240;
|
int32_t tsRestRowLimit = 10240;
|
||||||
uint16_t tsHttpPort = 6020; // only tcp, range tcp[6020]
|
uint16_t tsHttpPort = 6020; // only tcp, range tcp[6020]
|
||||||
int32_t tsHttpCacheSessions = 100;
|
int32_t tsHttpCacheSessions = 1000;
|
||||||
int32_t tsHttpSessionExpire = 36000;
|
int32_t tsHttpSessionExpire = 36000;
|
||||||
int32_t tsHttpMaxThreads = 2;
|
int32_t tsHttpMaxThreads = 2;
|
||||||
int32_t tsHttpEnableCompress = 0;
|
int32_t tsHttpEnableCompress = 0;
|
||||||
|
|
|
@ -206,7 +206,7 @@ typedef struct HttpThread {
|
||||||
pthread_mutex_t threadMutex;
|
pthread_mutex_t threadMutex;
|
||||||
bool stop;
|
bool stop;
|
||||||
int pollFd;
|
int pollFd;
|
||||||
int numOfFds;
|
int numOfContexts;
|
||||||
int threadId;
|
int threadId;
|
||||||
char label[HTTP_LABEL_SIZE];
|
char label[HTTP_LABEL_SIZE];
|
||||||
bool (*processData)(HttpContext *pContext);
|
bool (*processData)(HttpContext *pContext);
|
||||||
|
|
|
@ -44,7 +44,7 @@ static void httpDestroyContext(void *data) {
|
||||||
HttpThread *pThread = pContext->pThread;
|
HttpThread *pThread = pContext->pThread;
|
||||||
httpRemoveContextFromEpoll(pContext);
|
httpRemoveContextFromEpoll(pContext);
|
||||||
httpReleaseSession(pContext);
|
httpReleaseSession(pContext);
|
||||||
atomic_sub_fetch_32(&pThread->numOfFds, 1);
|
atomic_sub_fetch_32(&pThread->numOfContexts, 1);
|
||||||
|
|
||||||
pContext->pThread = 0;
|
pContext->pThread = 0;
|
||||||
pContext->state = HTTP_CONTEXT_STATE_CLOSED;
|
pContext->state = HTTP_CONTEXT_STATE_CLOSED;
|
||||||
|
@ -171,38 +171,39 @@ bool httpInitContext(HttpContext *pContext) {
|
||||||
|
|
||||||
void httpCloseContextByApp(HttpContext *pContext) {
|
void httpCloseContextByApp(HttpContext *pContext) {
|
||||||
pContext->parsed = false;
|
pContext->parsed = false;
|
||||||
|
|
||||||
bool keepAlive = true;
|
bool keepAlive = true;
|
||||||
|
|
||||||
if (pContext->httpVersion == HTTP_VERSION_10 && pContext->httpKeepAlive != HTTP_KEEPALIVE_ENABLE) {
|
if (pContext->httpVersion == HTTP_VERSION_10 && pContext->httpKeepAlive != HTTP_KEEPALIVE_ENABLE) {
|
||||||
keepAlive = false;
|
keepAlive = false;
|
||||||
} else if (pContext->httpVersion != HTTP_VERSION_10 && pContext->httpKeepAlive == HTTP_KEEPALIVE_DISABLE) {
|
} else if (pContext->httpVersion != HTTP_VERSION_10 && pContext->httpKeepAlive == HTTP_KEEPALIVE_DISABLE) {
|
||||||
keepAlive = false;
|
keepAlive = false;
|
||||||
} else {}
|
} else {
|
||||||
|
}
|
||||||
|
|
||||||
if (keepAlive) {
|
if (keepAlive) {
|
||||||
if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_HANDLING, HTTP_CONTEXT_STATE_READY)) {
|
if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_HANDLING, HTTP_CONTEXT_STATE_READY)) {
|
||||||
httpDebug("context:%p, fd:%d, ip:%s, last state:handling, keepAlive:true, reuse connect",
|
httpDebug("context:%p, fd:%d, ip:%s, last state:handling, keepAlive:true, reuse context", pContext, pContext->fd,
|
||||||
pContext, pContext->fd, pContext->ipstr);
|
pContext->ipstr);
|
||||||
} else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_DROPPING, HTTP_CONTEXT_STATE_CLOSED)) {
|
} else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_DROPPING, HTTP_CONTEXT_STATE_CLOSED)) {
|
||||||
httpRemoveContextFromEpoll(pContext);
|
httpRemoveContextFromEpoll(pContext);
|
||||||
httpDebug("context:%p, fd:%d, ip:%s, last state:dropping, keepAlive:true, close connect",
|
httpDebug("context:%p, fd:%d, ip:%s, last state:dropping, keepAlive:true, close connect", pContext, pContext->fd,
|
||||||
pContext, pContext->fd, pContext->ipstr);
|
pContext->ipstr);
|
||||||
} else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_READY, HTTP_CONTEXT_STATE_READY)) {
|
} else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_READY, HTTP_CONTEXT_STATE_READY)) {
|
||||||
httpDebug("context:%p, fd:%d, ip:%s, last state:ready, keepAlive:true, reuse connect",
|
httpDebug("context:%p, fd:%d, ip:%s, last state:ready, keepAlive:true, reuse context", pContext, pContext->fd,
|
||||||
pContext, pContext->fd, pContext->ipstr);
|
pContext->ipstr);
|
||||||
} else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_CLOSED, HTTP_CONTEXT_STATE_CLOSED)) {
|
} else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_CLOSED, HTTP_CONTEXT_STATE_CLOSED)) {
|
||||||
httpRemoveContextFromEpoll(pContext);
|
httpRemoveContextFromEpoll(pContext);
|
||||||
httpDebug("context:%p, fd:%d, ip:%s, last state:ready, keepAlive:true, close connect",
|
httpDebug("context:%p, fd:%d, ip:%s, last state:ready, keepAlive:true, close connect", pContext, pContext->fd,
|
||||||
pContext, pContext->fd, pContext->ipstr);
|
pContext->ipstr);
|
||||||
} else {
|
} else {
|
||||||
httpRemoveContextFromEpoll(pContext);
|
httpRemoveContextFromEpoll(pContext);
|
||||||
httpError("context:%p, fd:%d, ip:%s, last state:%s:%d, keepAlive:true, close connect",
|
httpError("context:%p, fd:%d, ip:%s, last state:%s:%d, keepAlive:true, close connect", pContext, pContext->fd,
|
||||||
pContext, pContext->fd, pContext->ipstr, httpContextStateStr(pContext->state), pContext->state);
|
pContext->ipstr, httpContextStateStr(pContext->state), pContext->state);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
httpRemoveContextFromEpoll(pContext);
|
httpRemoveContextFromEpoll(pContext);
|
||||||
httpDebug("context:%p, fd:%d, ip:%s, last state:%s:%d, keepAlive:false, close connect",
|
httpDebug("context:%p, fd:%d, ip:%s, last state:%s:%d, keepAlive:false, close context", pContext, pContext->fd,
|
||||||
pContext, pContext->fd, pContext->ipstr, httpContextStateStr(pContext->state), pContext->state);
|
pContext->ipstr, httpContextStateStr(pContext->state), pContext->state);
|
||||||
}
|
}
|
||||||
|
|
||||||
httpReleaseContext(pContext);
|
httpReleaseContext(pContext);
|
||||||
|
@ -214,7 +215,7 @@ void httpCloseContextByServer(HttpContext *pContext) {
|
||||||
} else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_DROPPING, HTTP_CONTEXT_STATE_DROPPING)) {
|
} else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_DROPPING, HTTP_CONTEXT_STATE_DROPPING)) {
|
||||||
httpDebug("context:%p, fd:%d, ip:%s, epoll already finished, wait app finished", pContext, pContext->fd, pContext->ipstr);
|
httpDebug("context:%p, fd:%d, ip:%s, epoll already finished, wait app finished", pContext, pContext->fd, pContext->ipstr);
|
||||||
} else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_READY, HTTP_CONTEXT_STATE_CLOSED)) {
|
} else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_READY, HTTP_CONTEXT_STATE_CLOSED)) {
|
||||||
httpDebug("context:%p, fd:%d, ip:%s, epoll finished, close context", pContext, pContext->fd, pContext->ipstr);
|
httpDebug("context:%p, fd:%d, ip:%s, epoll finished, close connect", pContext, pContext->fd, pContext->ipstr);
|
||||||
} else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_CLOSED, HTTP_CONTEXT_STATE_CLOSED)) {
|
} else if (httpAlterContextState(pContext, HTTP_CONTEXT_STATE_CLOSED, HTTP_CONTEXT_STATE_CLOSED)) {
|
||||||
httpDebug("context:%p, fd:%d, ip:%s, epoll finished, will be closed soon", pContext, pContext->fd, pContext->ipstr);
|
httpDebug("context:%p, fd:%d, ip:%s, epoll finished, will be closed soon", pContext, pContext->fd, pContext->ipstr);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -313,9 +313,9 @@ bool httpParseRequest(HttpContext* pContext) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
httpTraceL("context:%p, fd:%d, ip:%s, thread:%s, numOfFds:%d, read size:%d, raw data:\n%s", pContext, pContext->fd,
|
httpTraceL("context:%p, fd:%d, ip:%s, thread:%s, numOfContexts:%d, read size:%d, raw data:\n%s", pContext,
|
||||||
pContext->ipstr, pContext->pThread->label, pContext->pThread->numOfFds, pContext->parser.bufsize,
|
pContext->fd, pContext->ipstr, pContext->pThread->label, pContext->pThread->numOfContexts,
|
||||||
pContext->parser.buffer);
|
pContext->parser.bufsize, pContext->parser.buffer);
|
||||||
|
|
||||||
if (!httpGetHttpMethod(pContext)) {
|
if (!httpGetHttpMethod(pContext)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -293,7 +293,7 @@ static void *httpAcceptHttpConnection(void *arg) {
|
||||||
|
|
||||||
totalFds = 1;
|
totalFds = 1;
|
||||||
for (int i = 0; i < pServer->numOfThreads; ++i) {
|
for (int i = 0; i < pServer->numOfThreads; ++i) {
|
||||||
totalFds += pServer->pThreads[i].numOfFds;
|
totalFds += pServer->pThreads[i].numOfContexts;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (totalFds > tsHttpCacheSessions * 100) {
|
if (totalFds > tsHttpCacheSessions * 100) {
|
||||||
|
@ -332,9 +332,9 @@ static void *httpAcceptHttpConnection(void *arg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// notify the data process, add into the FdObj list
|
// notify the data process, add into the FdObj list
|
||||||
atomic_add_fetch_32(&pThread->numOfFds, 1);
|
atomic_add_fetch_32(&pThread->numOfContexts, 1);
|
||||||
httpDebug("context:%p, fd:%d, ip:%s, thread:%s numOfFds:%d totalFds:%d, accept a new connection", pContext, connFd,
|
httpDebug("context:%p, fd:%d, ip:%s, thread:%s numOfContexts:%d totalFds:%d, accept a new connection", pContext,
|
||||||
pContext->ipstr, pThread->label, pThread->numOfFds, totalFds);
|
connFd, pContext->ipstr, pThread->label, pThread->numOfContexts, totalFds);
|
||||||
|
|
||||||
// pick up next thread for next connection
|
// pick up next thread for next connection
|
||||||
threadId++;
|
threadId++;
|
||||||
|
|
|
@ -117,8 +117,6 @@ cd ../../../debug; make
|
||||||
./test.sh -f general/parser/import_commit3.sim
|
./test.sh -f general/parser/import_commit3.sim
|
||||||
./test.sh -f general/parser/insert_tb.sim
|
./test.sh -f general/parser/insert_tb.sim
|
||||||
./test.sh -f general/parser/first_last.sim
|
./test.sh -f general/parser/first_last.sim
|
||||||
# dyh is processing this script
|
|
||||||
#./test.sh -f general/parser/import_file.sim
|
|
||||||
./test.sh -f general/parser/lastrow.sim
|
./test.sh -f general/parser/lastrow.sim
|
||||||
./test.sh -f general/parser/nchar.sim
|
./test.sh -f general/parser/nchar.sim
|
||||||
./test.sh -f general/parser/null_char.sim
|
./test.sh -f general/parser/null_char.sim
|
||||||
|
@ -145,7 +143,6 @@ cd ../../../debug; make
|
||||||
./test.sh -f general/parser/groupby.sim
|
./test.sh -f general/parser/groupby.sim
|
||||||
./test.sh -f general/parser/set_tag_vals.sim
|
./test.sh -f general/parser/set_tag_vals.sim
|
||||||
#./test.sh -f general/parser/sliding.sim
|
#./test.sh -f general/parser/sliding.sim
|
||||||
./test.sh -f general/parser/tags_dynamically_specifiy.sim
|
|
||||||
./test.sh -f general/parser/tags_filter.sim
|
./test.sh -f general/parser/tags_filter.sim
|
||||||
./test.sh -f general/parser/slimit_alter_tags.sim
|
./test.sh -f general/parser/slimit_alter_tags.sim
|
||||||
./test.sh -f general/parser/join.sim
|
./test.sh -f general/parser/join.sim
|
||||||
|
|
|
@ -125,7 +125,6 @@ echo "mqttDebugFlag 131" >> $TAOS_CFG
|
||||||
echo "qdebugFlag 135" >> $TAOS_CFG
|
echo "qdebugFlag 135" >> $TAOS_CFG
|
||||||
echo "rpcDebugFlag 135" >> $TAOS_CFG
|
echo "rpcDebugFlag 135" >> $TAOS_CFG
|
||||||
echo "tmrDebugFlag 131" >> $TAOS_CFG
|
echo "tmrDebugFlag 131" >> $TAOS_CFG
|
||||||
echo "cDebugFlag 135" >> $TAOS_CFG
|
|
||||||
echo "udebugFlag 135" >> $TAOS_CFG
|
echo "udebugFlag 135" >> $TAOS_CFG
|
||||||
echo "sdebugFlag 135" >> $TAOS_CFG
|
echo "sdebugFlag 135" >> $TAOS_CFG
|
||||||
echo "wdebugFlag 135" >> $TAOS_CFG
|
echo "wdebugFlag 135" >> $TAOS_CFG
|
||||||
|
|
Loading…
Reference in New Issue