未验证 提交 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) {
return;
}
pObj->pHb->retry = 0;
tscProcessSql(pObj->pHb);
}
......
......@@ -122,6 +122,8 @@ extern int tsBalancePolicy;
extern int tsOfflineThreshold;
extern int tsMgmtEqualVnodeNum;
extern int tsTCPTransferThreshold;
extern int tsEnableHttpModule;
extern int tsEnableMonitorModule;
extern int tsRestRowLimit;
......@@ -256,7 +258,7 @@ extern int tsGlobalConfigNum;
extern char * tsCfgStatusStr[];
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_OPTION_LEN 24
#define TSDB_CFG_VALUE_LEN 41
......
......@@ -299,7 +299,7 @@ void *taosTransferDataViaTcp(void *argv) {
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,
handleViaTcp.hash);
taosCloseSocket(connFd);
......@@ -365,7 +365,7 @@ void *taosTransferDataViaTcp(void *argv) {
pHeader = (STaosHeader *)handle;
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);
} else {
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
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) {
struct sockaddr_in destAdd;
......
......@@ -130,6 +130,8 @@ int tsBalancePolicy = 0; // 1-use sys.montor
int tsOfflineThreshold = 864000; // seconds 10days
int tsMgmtEqualVnodeNum = 4;
int tsTCPTransferThreshold = 65480; // RPC_MAX_UDP_SIZE
int tsEnableHttpModule = 1;
int tsEnableMonitorModule = 1;
int tsRestRowLimit = 10240;
......@@ -710,6 +712,10 @@ static void doInitGlobalConfig() {
TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT,
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
tsInitConfigOption(cfg++, "maxShellConns", &tsMaxShellConns, TSDB_CFG_VTYPE_INT,
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.
先完成此消息的编辑!
想要评论请 注册