From 7a4bbc5c23bcb244953e39001722e711b759a7fe Mon Sep 17 00:00:00 2001 From: hjxilinx Date: Fri, 15 Nov 2019 11:11:23 +0800 Subject: [PATCH] [tbase-1147] --- src/client/src/tscServer.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index e980e55446..cea17400cd 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -320,11 +320,19 @@ int tscSendMsgToServer(SSqlObj *pSql) { char *pStart = taosBuildReqHeader(pSql->thandle, pSql->cmd.msgType, buf); if (pStart) { + /* + * this SQL object may be released by other thread due to the completion of this query even before the log + * is dumped to log file. So the signature needs to be kept in a local variable. + */ + uint64_t signature = (uint64_t) pSql->signature; if (tscUpdateVnodeMsg[pSql->cmd.command]) (*tscUpdateVnodeMsg[pSql->cmd.command])(pSql, buf); + int ret = taosSendMsgToPeerH(pSql->thandle, pStart, pSql->cmd.payloadLen, pSql); - - if (ret >= 0) code = 0; - tscTrace("%p send msg ret:%d code:%d sig:%p", pSql, ret, code, pSql->signature); + if (ret >= 0) { + code = 0; + } + + tscTrace("%p send msg ret:%d code:%d sig:%p", pSql, ret, code, signature); } } -- GitLab