From 7214cea808dff1c0ffbe932b2e52465e180813f9 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 10 Jul 2024 18:16:51 +0800 Subject: [PATCH] fix(stream): check if task is killed during generated interval results. --- source/libs/executor/src/streamtimewindowoperator.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source/libs/executor/src/streamtimewindowoperator.c b/source/libs/executor/src/streamtimewindowoperator.c index 5b9c018bba..d609fdf219 100644 --- a/source/libs/executor/src/streamtimewindowoperator.c +++ b/source/libs/executor/src/streamtimewindowoperator.c @@ -1236,8 +1236,15 @@ static void copyIntervalDeleteKey(SSHashObj* pMap, SArray* pWins) { static SSDataBlock* buildIntervalResult(SOperatorInfo* pOperator) { SStreamIntervalOperatorInfo* pInfo = pOperator->info; - SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; - uint16_t opType = pOperator->operatorType; + + SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; + uint16_t opType = pOperator->operatorType; + + // check if query task is closed or not + if (isTaskKilled(pTaskInfo)) { + return NULL; + } + if (IS_FINAL_INTERVAL_OP(pOperator)) { doBuildPullDataBlock(pInfo->pPullWins, &pInfo->pullIndex, pInfo->pPullDataRes); if (pInfo->pPullDataRes->info.rows != 0) {