提交 40c7208c 编写于 作者: H Haojun Liao

[td-225]

上级 b3165d41
......@@ -6229,6 +6229,7 @@ static SQInfo *createQInfoImpl(SQueryTableMsg *pQueryMsg, SSqlGroupbyExpr *pGrou
pQInfo->dataReady = QUERY_RESULT_NOT_READY;
pQInfo->rspContext = NULL;
pthread_mutex_init(&pQInfo->lock, NULL);
tsem_init(&pQInfo->ready, 0, 0);
pQuery->pos = -1;
pQuery->window = pQueryMsg->window;
......
......@@ -272,6 +272,11 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, SReadMsg *pReadMsg) {
if (pRetrieve->free == 1) {
vWarn("vgId:%d, QInfo:%p, retrieve msg received to kill query and free qhandle", pVnode->vgId, *handle);
qKillQuery(*handle);
#if !(_NON_BLOCKING_RETRIEVE)
void** p = handle;
qReleaseQInfo(pVnode->qMgmt, (void **)&p, false);
#endif
qReleaseQInfo(pVnode->qMgmt, (void **)&handle, true);
vnodeBuildNoResultQueryRsp(pRet);
......@@ -285,6 +290,12 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, SReadMsg *pReadMsg) {
pReadMsg->rpcMsg.handle);
code = TSDB_CODE_RPC_NETWORK_UNAVAIL;
qKillQuery(*handle);
#if !(_NON_BLOCKING_RETRIEVE)
void** p = handle;
qReleaseQInfo(pVnode->qMgmt, (void **)&p, false);
#endif
qReleaseQInfo(pVnode->qMgmt, (void **)&handle, true);
return code;
}
......@@ -314,6 +325,11 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, SReadMsg *pReadMsg) {
code = vnodeDumpQueryResult(pRet, pVnode, handle, &freeHandle, pReadMsg->rpcMsg.ahandle);
}
#if !(_NON_BLOCKING_RETRIEVE)
void** p = handle;
qReleaseQInfo(pVnode->qMgmt, (void **)&p, false);
#endif
// If qhandle is not added into vread queue, the query should be completed already or paused with error.
// Here free qhandle immediately
if (freeHandle) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册