未验证 提交 a74b6144 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #4034 from taosdata/hotfix/16_query_crash

Hotfix/16 query crash
...@@ -184,6 +184,7 @@ void tscProcessActivityTimer(void *handle, void *tmrId) { ...@@ -184,6 +184,7 @@ void tscProcessActivityTimer(void *handle, void *tmrId) {
return; return;
} }
pObj->pHb->retry = 0;
tscProcessSql(pObj->pHb); tscProcessSql(pObj->pHb);
} }
......
...@@ -122,6 +122,8 @@ extern int tsBalancePolicy; ...@@ -122,6 +122,8 @@ extern int tsBalancePolicy;
extern int tsOfflineThreshold; extern int tsOfflineThreshold;
extern int tsMgmtEqualVnodeNum; extern int tsMgmtEqualVnodeNum;
extern int tsTCPTransferThreshold;
extern int tsEnableHttpModule; extern int tsEnableHttpModule;
extern int tsEnableMonitorModule; extern int tsEnableMonitorModule;
extern int tsRestRowLimit; extern int tsRestRowLimit;
...@@ -256,7 +258,7 @@ extern int tsGlobalConfigNum; ...@@ -256,7 +258,7 @@ extern int tsGlobalConfigNum;
extern char * tsCfgStatusStr[]; extern char * tsCfgStatusStr[];
SGlobalConfig *tsGetConfigOption(const char *option); SGlobalConfig *tsGetConfigOption(const char *option);
#define TSDB_CFG_MAX_NUM 111 #define TSDB_CFG_MAX_NUM 130
#define TSDB_CFG_PRINT_LEN 23 #define TSDB_CFG_PRINT_LEN 23
#define TSDB_CFG_OPTION_LEN 24 #define TSDB_CFG_OPTION_LEN 24
#define TSDB_CFG_VALUE_LEN 41 #define TSDB_CFG_VALUE_LEN 41
......
...@@ -299,7 +299,7 @@ void *taosTransferDataViaTcp(void *argv) { ...@@ -299,7 +299,7 @@ void *taosTransferDataViaTcp(void *argv) {
return NULL; return NULL;
} }
if (!taosCheckHandleViaTcpValid(&handleViaTcp)) { if (handleViaTcp.handle && !taosCheckHandleViaTcpValid(&handleViaTcp)) {
tError("%s UDP server read handle via tcp invalid, handle:%" PRIu64 ", hash:%" PRIu64, pSet->label, handleViaTcp.handle, tError("%s UDP server read handle via tcp invalid, handle:%" PRIu64 ", hash:%" PRIu64, pSet->label, handleViaTcp.handle,
handleViaTcp.hash); handleViaTcp.hash);
taosCloseSocket(connFd); taosCloseSocket(connFd);
...@@ -365,7 +365,7 @@ void *taosTransferDataViaTcp(void *argv) { ...@@ -365,7 +365,7 @@ void *taosTransferDataViaTcp(void *argv) {
pHeader = (STaosHeader *)handle; pHeader = (STaosHeader *)handle;
msgLen = (int32_t)htonl((uint32_t)pHeader->msgLen); msgLen = (int32_t)htonl((uint32_t)pHeader->msgLen);
if (pHeader->tcp != 0 || msgLen < 1024) { if (pHeader->tcp != 0 || msgLen < 100) {
tError("%s invalid handle:%p, connection shall be closed", pSet->label, pHeader); tError("%s invalid handle:%p, connection shall be closed", pSet->label, pHeader);
} else { } else {
SMonitor *pMonitor = (SMonitor *)calloc(1, sizeof(SMonitor)); SMonitor *pMonitor = (SMonitor *)calloc(1, sizeof(SMonitor));
...@@ -756,7 +756,8 @@ int taosSendUdpData(uint32_t ip, uint16_t port, char *data, int dataLen, void *c ...@@ -756,7 +756,8 @@ int taosSendUdpData(uint32_t ip, uint16_t port, char *data, int dataLen, void *c
if (pConn == NULL || pConn->signature != pConn) return -1; if (pConn == NULL || pConn->signature != pConn) return -1;
if (dataLen >= RPC_MAX_UDP_SIZE) return taosSendPacketViaTcp(ip, port, data, dataLen, chandle); assert(tsTCPTransferThreshold <= RPC_MAX_UDP_SIZE && tsTCPTransferThreshold > 0);
if (dataLen >= tsTCPTransferThreshold) return taosSendPacketViaTcp(ip, port, data, dataLen, chandle);
if (pConn->hash == NULL) { if (pConn->hash == NULL) {
struct sockaddr_in destAdd; struct sockaddr_in destAdd;
......
...@@ -130,6 +130,8 @@ int tsBalancePolicy = 0; // 1-use sys.montor ...@@ -130,6 +130,8 @@ int tsBalancePolicy = 0; // 1-use sys.montor
int tsOfflineThreshold = 864000; // seconds 10days int tsOfflineThreshold = 864000; // seconds 10days
int tsMgmtEqualVnodeNum = 4; int tsMgmtEqualVnodeNum = 4;
int tsTCPTransferThreshold = 65480; // RPC_MAX_UDP_SIZE
int tsEnableHttpModule = 1; int tsEnableHttpModule = 1;
int tsEnableMonitorModule = 1; int tsEnableMonitorModule = 1;
int tsRestRowLimit = 10240; int tsRestRowLimit = 10240;
...@@ -710,6 +712,10 @@ static void doInitGlobalConfig() { ...@@ -710,6 +712,10 @@ static void doInitGlobalConfig() {
TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT, TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT,
0, 0, tListLen(tsCharset), TSDB_CFG_UTYPE_NONE); 0, 0, tListLen(tsCharset), TSDB_CFG_UTYPE_NONE);
tsInitConfigOption(cfg++, "tcptransferThreshold", &tsTCPTransferThreshold, TSDB_CFG_VTYPE_INT,
TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW,
500, 65480, 0, TSDB_CFG_UTYPE_BYTE);
// connect configs // connect configs
tsInitConfigOption(cfg++, "maxShellConns", &tsMaxShellConns, TSDB_CFG_VTYPE_INT, tsInitConfigOption(cfg++, "maxShellConns", &tsMaxShellConns, TSDB_CFG_VTYPE_INT,
TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW, TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册