提交 23ac4cbc 编写于 作者: dengyihao's avatar dengyihao

handle except

上级 5bb762e5
...@@ -708,7 +708,7 @@ static int32_t sifCalculate(SNode *pNode, SIFParam *pDst) { ...@@ -708,7 +708,7 @@ static int32_t sifCalculate(SNode *pNode, SIFParam *pDst) {
taosHashRemove(ctx.pRes, (void *)&pNode, POINTER_BYTES); taosHashRemove(ctx.pRes, (void *)&pNode, POINTER_BYTES);
} }
sifFreeRes(ctx.pRes); sifFreeRes(ctx.pRes);
SIF_RET(code); SIF_RET(code);
} }
......
...@@ -196,6 +196,7 @@ static void cliReleaseUnfinishedMsg(SCliConn* conn) { ...@@ -196,6 +196,7 @@ static void cliReleaseUnfinishedMsg(SCliConn* conn) {
CONN_GET_MSGCTX_BY_AHANDLE(conn, ahandle); \ CONN_GET_MSGCTX_BY_AHANDLE(conn, ahandle); \
transClearBuffer(&conn->readBuf); \ transClearBuffer(&conn->readBuf); \
transFreeMsg(transContFromHead((char*)head)); \ transFreeMsg(transContFromHead((char*)head)); \
if (transQueueSize(&conn->cliMsgs) > 0 && ahandle == 0) return; \
tDebug("%s conn %p receive release request, ref:%d", CONN_GET_INST_LABEL(conn), conn, T_REF_VAL_GET(conn)); \ tDebug("%s conn %p receive release request, ref:%d", CONN_GET_INST_LABEL(conn), conn, T_REF_VAL_GET(conn)); \
if (T_REF_VAL_GET(conn) > 1) { \ if (T_REF_VAL_GET(conn) > 1) { \
transUnrefCliHandle(conn); \ transUnrefCliHandle(conn); \
......
...@@ -149,34 +149,35 @@ static void* transAcceptThread(void* arg); ...@@ -149,34 +149,35 @@ static void* transAcceptThread(void* arg);
static bool addHandleToWorkloop(SWorkThrd* pThrd, char* pipeName); static bool addHandleToWorkloop(SWorkThrd* pThrd, char* pipeName);
static bool addHandleToAcceptloop(void* arg); static bool addHandleToAcceptloop(void* arg);
#define CONN_SHOULD_RELEASE(conn, head) \ #define CONN_SHOULD_RELEASE(conn, head) \
do { \ do { \
if ((head)->release == 1 && (head->msgLen) == sizeof(*head)) { \ if ((head)->release == 1 && (head->msgLen) == sizeof(*head)) { \
reallocConnRef(conn); \ reallocConnRef(conn); \
tTrace("conn %p received release request", conn); \ tTrace("conn %p received release request", conn); \
\ \
STraceId traceId = head->traceId; \ STraceId traceId = head->traceId; \
conn->status = ConnRelease; \ conn->status = ConnRelease; \
transClearBuffer(&conn->readBuf); \ transClearBuffer(&conn->readBuf); \
transFreeMsg(transContFromHead((char*)head)); \ transFreeMsg(transContFromHead((char*)head)); \
\ \
STransMsg tmsg = {.code = 0, .info.handle = (void*)conn, .info.traceId = traceId, .info.ahandle = NULL}; \ STransMsg tmsg = { \
SSvrMsg* srvMsg = taosMemoryCalloc(1, sizeof(SSvrMsg)); \ .code = 0, .info.handle = (void*)conn, .info.traceId = traceId, .info.ahandle = (void*)0x9527}; \
srvMsg->msg = tmsg; \ SSvrMsg* srvMsg = taosMemoryCalloc(1, sizeof(SSvrMsg)); \
srvMsg->type = Release; \ srvMsg->msg = tmsg; \
srvMsg->pConn = conn; \ srvMsg->type = Release; \
if (!transQueuePush(&conn->srvMsgs, srvMsg)) { \ srvMsg->pConn = conn; \
return; \ if (!transQueuePush(&conn->srvMsgs, srvMsg)) { \
} \ return; \
if (conn->regArg.init) { \ } \
tTrace("conn %p release, notify server app", conn); \ if (conn->regArg.init) { \
STrans* pTransInst = conn->pTransInst; \ tTrace("conn %p release, notify server app", conn); \
(*pTransInst->cfp)(pTransInst->parent, &(conn->regArg.msg), NULL); \ STrans* pTransInst = conn->pTransInst; \
memset(&conn->regArg, 0, sizeof(conn->regArg)); \ (*pTransInst->cfp)(pTransInst->parent, &(conn->regArg.msg), NULL); \
} \ memset(&conn->regArg, 0, sizeof(conn->regArg)); \
uvStartSendRespInternal(srvMsg); \ } \
return; \ uvStartSendRespInternal(srvMsg); \
} \ return; \
} \
} while (0) } while (0)
#define SRV_RELEASE_UV(loop) \ #define SRV_RELEASE_UV(loop) \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册