diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 631a9b5eb3f6c41a7e74e606f2d8f239cfc6479d..e9b84ecd13bbcce1e97b71032a1f4959ec3ba53d 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -195,7 +195,10 @@ int tscSendMsgToServer(SSqlObj *pSql) { .code = 0 }; - pSql->pRpcCtx = rpcSendRequest(pObj->pDnodeConn, &pSql->ipList, &rpcMsg); + // NOTE: the rpc context should be acquired before sent data to server. + // Otherwise, the pSql object may have been released already in during the processMsgFromServer function, in the + // meanwhile, the assignment of the rpc context to sql object will absolutely caused crash. + /*pSql->pRpcCtx = */rpcSendRequest(pObj->pDnodeConn, &pSql->ipList, &rpcMsg); return TSDB_CODE_SUCCESS; }