reset timeout
This commit is contained in:
parent
de51fa24b3
commit
3aad2757ef
|
@ -85,7 +85,7 @@ void* rpcOpen(const SRpcInit* pInit) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pRpc->readTimeout = pInit->readTimeout;
|
pRpc->readTimeout = pInit->readTimeout;
|
||||||
if (pRpc->readTimeout <= 0) {
|
if (pRpc->readTimeout < 0) {
|
||||||
pRpc->readTimeout = INT64_MAX;
|
pRpc->readTimeout = INT64_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -704,7 +704,7 @@ bool filterToRmTimoutReq(void* key, void* arg) {
|
||||||
SCliReq* pReq = QUEUE_DATA(key, SCliReq, q);
|
SCliReq* pReq = QUEUE_DATA(key, SCliReq, q);
|
||||||
if (pReq->msg.info.qId == 0 && !REQUEST_NO_RESP(&pReq->msg) && pReq->ctx) {
|
if (pReq->msg.info.qId == 0 && !REQUEST_NO_RESP(&pReq->msg) && pReq->ctx) {
|
||||||
int64_t elapse = ((taosGetTimestampUs() - pReq->st) / 1000000);
|
int64_t elapse = ((taosGetTimestampUs() - pReq->st) / 1000000);
|
||||||
if (filterArg && (elapse > filterArg->pInst->readTimeout)) {
|
if (filterArg && (elapse >= filterArg->pInst->readTimeout)) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
@ -718,7 +718,7 @@ bool filterToDebug_timeoutMsg(void* key, void* arg) {
|
||||||
SCliReq* pReq = QUEUE_DATA(key, SCliReq, q);
|
SCliReq* pReq = QUEUE_DATA(key, SCliReq, q);
|
||||||
if (pReq->msg.info.qId == 0 && !REQUEST_NO_RESP(&pReq->msg) && pReq->ctx) {
|
if (pReq->msg.info.qId == 0 && !REQUEST_NO_RESP(&pReq->msg) && pReq->ctx) {
|
||||||
int64_t elapse = ((taosGetTimestampUs() - pReq->st) / 1000000);
|
int64_t elapse = ((taosGetTimestampUs() - pReq->st) / 1000000);
|
||||||
if (filterArg && elapse > filterArg->pInst->readTimeout) {
|
if (filterArg && elapse >= filterArg->pInst->readTimeout) {
|
||||||
tWarn("req %s timeout, elapse:%" PRId64 "ms", TMSG_INFO(pReq->msg.msgType), elapse);
|
tWarn("req %s timeout, elapse:%" PRId64 "ms", TMSG_INFO(pReq->msg.msgType), elapse);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -3612,7 +3612,7 @@ bool filterTimeoutReq(void* key, void* arg) {
|
||||||
SCliReq* pReq = QUEUE_DATA(key, SCliReq, q);
|
SCliReq* pReq = QUEUE_DATA(key, SCliReq, q);
|
||||||
if (pReq->msg.info.qId == 0 && !REQUEST_NO_RESP(&pReq->msg) && pReq->ctx) {
|
if (pReq->msg.info.qId == 0 && !REQUEST_NO_RESP(&pReq->msg) && pReq->ctx) {
|
||||||
int64_t elapse = ((st - pReq->st) / 1000000);
|
int64_t elapse = ((st - pReq->st) / 1000000);
|
||||||
if (listArg && elapse > listArg->pInst->readTimeout) {
|
if (listArg && elapse >= listArg->pInst->readTimeout) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
@ -3632,7 +3632,7 @@ static void cliConnRemoveTimoutQidMsg(SCliConn* pConn, int64_t* st, queue* set)
|
||||||
STransCtx* pCtx = (STransCtx*)pIter;
|
STransCtx* pCtx = (STransCtx*)pIter;
|
||||||
int64_t* qid = taosHashGetKey(pIter, NULL);
|
int64_t* qid = taosHashGetKey(pIter, NULL);
|
||||||
|
|
||||||
if (((*st - pCtx->st) / 1000000) > pInst->readTimeout) {
|
if (((*st - pCtx->st) / 1000000) >= pInst->readTimeout) {
|
||||||
code = taosHashRemove(pThrd->pIdConnTable, qid, sizeof(*qid));
|
code = taosHashRemove(pThrd->pIdConnTable, qid, sizeof(*qid));
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
tError("%s conn %p failed to remove state sid:%" PRId64 " since %s", CONN_GET_INST_LABEL(pConn), pConn, *qid,
|
tError("%s conn %p failed to remove state sid:%" PRId64 " since %s", CONN_GET_INST_LABEL(pConn), pConn, *qid,
|
||||||
|
@ -3674,6 +3674,7 @@ static void cliConnRemoveTimeoutNoQidMsg(SCliConn* pConn, int64_t* st, queue* se
|
||||||
SCliThrd* pThrd = pConn->hostThrd;
|
SCliThrd* pThrd = pConn->hostThrd;
|
||||||
STrans* pInst = pThrd->pInst;
|
STrans* pInst = pThrd->pInst;
|
||||||
SListFilterArg arg = {.id = *st, .pInst = pInst};
|
SListFilterArg arg = {.id = *st, .pInst = pInst};
|
||||||
|
transQueueRemoveByFilter(&pConn->reqsSentOut, filterTimeoutReq, &arg, set, -1);
|
||||||
transQueueRemoveByFilter(&pConn->reqsToSend, filterTimeoutReq, &arg, set, -1);
|
transQueueRemoveByFilter(&pConn->reqsToSend, filterTimeoutReq, &arg, set, -1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue