From d8292d663031060e57e31fe5a28616809f8dd285 Mon Sep 17 00:00:00 2001 From: slguan Date: Thu, 21 Nov 2019 18:58:05 +0800 Subject: [PATCH] [TBASE-1213] --- src/modules/http/inc/httpHandle.h | 2 +- src/modules/http/src/httpServer.c | 6 +++--- src/modules/http/src/httpSystem.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modules/http/inc/httpHandle.h b/src/modules/http/inc/httpHandle.h index e7ac0365c2..4f34a43cbd 100644 --- a/src/modules/http/inc/httpHandle.h +++ b/src/modules/http/inc/httpHandle.h @@ -63,7 +63,7 @@ #define HTTP_WRITE_RETRY_TIMES 500 #define HTTP_WRITE_WAIT_TIME_MS 5 #define HTTP_EXPIRED_TIME 60000 -#define HTTP_DELAY_CLOSE_TIME_MS 1000 +#define HTTP_DELAY_CLOSE_TIME_MS 500 #define HTTP_COMPRESS_IDENTITY 0 #define HTTP_COMPRESS_GZIP 2 diff --git a/src/modules/http/src/httpServer.c b/src/modules/http/src/httpServer.c index ae8f9eeaad..333b770a5f 100644 --- a/src/modules/http/src/httpServer.c +++ b/src/modules/http/src/httpServer.c @@ -107,9 +107,9 @@ void httpCleanUpContextTimer(HttpContext *pContext) { } void httpCleanUpContext(HttpContext *pContext) { - httpTrace("context:%p, start the clean up operation", pContext); - atomic_val_compare_exchange_ptr(&pContext->signature, pContext, 0); - if (pContext->signature != NULL) { + httpTrace("context:%p, start the clean up operation, sig:%p", pContext, pContext->signature); + void *sig = atomic_val_compare_exchange_ptr(&pContext->signature, pContext, 0); + if (sig == NULL) { httpTrace("context:%p is freed by another thread.", pContext); return; } diff --git a/src/modules/http/src/httpSystem.c b/src/modules/http/src/httpSystem.c index df49251f13..93d2b1d2cd 100644 --- a/src/modules/http/src/httpSystem.c +++ b/src/modules/http/src/httpSystem.c @@ -89,7 +89,7 @@ int httpStartSystem() { } if (httpServer->timerHandle == NULL) { - httpServer->timerHandle = taosTmrInit(tsHttpCacheSessions * 20 + 100, 1000, 60000, "http"); + httpServer->timerHandle = taosTmrInit(tsHttpCacheSessions * 20 + 100, 200, 60000, "http"); } if (httpServer->timerHandle == NULL) { httpError("http init timer failed");