fix: quick rsp lock issue

This commit is contained in:
dapan1121 2023-04-13 18:30:13 +08:00
parent 8ad82f07b0
commit 7800da65ae
1 changed files with 28 additions and 24 deletions

View File

@ -441,8 +441,9 @@ int32_t qwGetDeleteResFromSink(QW_FPARAMS_DEF, SQWTaskCtx *ctx, SDeleteRes *pRes
int32_t qwQuickRspFetchReq(QW_FPARAMS_DEF, SQWTaskCtx * ctx, SQWMsg *qwMsg, int32_t code) {
if (QUERY_RSP_POLICY_QUICK == tsQueryRspPolicy && ctx != NULL) {
QW_LOCK(QW_WRITE, &ctx->lock);
if (QUERY_RSP_POLICY_QUICK == tsQueryRspPolicy && ctx != NULL && QW_EVENT_RECEIVED(ctx, QW_EVENT_FETCH)) {
if (QW_EVENT_RECEIVED(ctx, QW_EVENT_FETCH)) {
QW_SET_EVENT_PROCESSED(ctx, QW_EVENT_FETCH);
QW_UNLOCK(QW_WRITE, &ctx->lock);
@ -469,6 +470,9 @@ int32_t qwQuickRspFetchReq(QW_FPARAMS_DEF, SQWTaskCtx * ctx, SQWMsg *qwMsg, i
QW_TASK_DLOG("fetch rsp send, handle:%p, code:%x - %s, dataLen:%d", qwMsg->connInfo.handle, code, tstrerror(code),
dataLen);
} else {
QW_UNLOCK(QW_WRITE, &ctx->lock);
}
} else {
QW_SET_EVENT_RECEIVED(ctx, QW_EVENT_FETCH);
}