提交 2fb3de1a 编写于 作者: A Alex Duan

fix(client): pSql->subStates maybe free by recreate

上级 425b831e
...@@ -283,6 +283,17 @@ int tscBuildQueryStreamDesc(void *pMsg, STscObj *pObj) { ...@@ -283,6 +283,17 @@ int tscBuildQueryStreamDesc(void *pMsg, STscObj *pObj) {
pthread_mutex_lock(&pSql->subState.mutex); pthread_mutex_lock(&pSql->subState.mutex);
if (pSql->pSubs != NULL && pSql->subState.states != NULL) { if (pSql->pSubs != NULL && pSql->subState.states != NULL) {
for (int32_t i = 0; i < pQdesc->numOfSub; ++i) { for (int32_t i = 0; i < pQdesc->numOfSub; ++i) {
// because subState maybe free on anytime by any thread, check validate from here
if(pSql->subState.numOfSub != pQdesc->numOfSub ||
pSql->pSubs == NULL ||
pSql->subState.states == NULL) {
tscError(" QUERY-HEART STscObj=%p subState maybe free. numOfSub=%d pSubs=%p states=%p",
pObj, pSql->subState.numOfSub, pSql->pSubs, pSql->subState.states);
pQdesc->numOfSub = 0;
// break for
break;
}
SSqlObj *psub = pSql->pSubs[i]; SSqlObj *psub = pSql->pSubs[i];
int64_t self = (psub != NULL)? psub->self : 0; int64_t self = (psub != NULL)? psub->self : 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册