Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6ae9a421
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6ae9a421
编写于
1月 04, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix crash while process transmsg
上级
c0aded7b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
44 addition
and
32 deletion
+44
-32
source/dnode/mgmt/impl/src/dndQnode.c
source/dnode/mgmt/impl/src/dndQnode.c
+10
-8
source/dnode/mgmt/impl/src/dndSnode.c
source/dnode/mgmt/impl/src/dndSnode.c
+10
-8
source/dnode/mnode/impl/src/mnode.c
source/dnode/mnode/impl/src/mnode.c
+9
-7
source/dnode/mnode/impl/test/qnode/qnode.cpp
source/dnode/mnode/impl/test/qnode/qnode.cpp
+13
-9
source/libs/transport/src/rpcMain.c
source/libs/transport/src/rpcMain.c
+2
-0
未找到文件。
source/dnode/mgmt/impl/src/dndQnode.c
浏览文件 @
6ae9a421
...
...
@@ -306,14 +306,16 @@ static void dndProcessQnodeQueue(SDnode *pDnode, SRpcMsg *pMsg) {
}
dndReleaseQnode
(
pDnode
,
pQnode
);
if
(
pRsp
!=
NULL
)
{
pRsp
->
ahandle
=
pMsg
->
ahandle
;
rpcSendResponse
(
pRsp
);
free
(
pRsp
);
}
else
{
if
(
code
!=
0
)
code
=
terrno
;
SRpcMsg
rpcRsp
=
{.
handle
=
pMsg
->
handle
,
.
ahandle
=
pMsg
->
ahandle
,
.
code
=
code
};
rpcSendResponse
(
&
rpcRsp
);
if
(
pMsg
->
msgType
&
1u
)
{
if
(
pRsp
!=
NULL
)
{
pRsp
->
ahandle
=
pMsg
->
ahandle
;
rpcSendResponse
(
pRsp
);
free
(
pRsp
);
}
else
{
if
(
code
!=
0
)
code
=
terrno
;
SRpcMsg
rpcRsp
=
{.
handle
=
pMsg
->
handle
,
.
ahandle
=
pMsg
->
ahandle
,
.
code
=
code
};
rpcSendResponse
(
&
rpcRsp
);
}
}
rpcFreeCont
(
pMsg
->
pCont
);
...
...
source/dnode/mgmt/impl/src/dndSnode.c
浏览文件 @
6ae9a421
...
...
@@ -300,14 +300,16 @@ static void dndProcessSnodeQueue(SDnode *pDnode, SRpcMsg *pMsg) {
}
dndReleaseSnode
(
pDnode
,
pSnode
);
if
(
pRsp
!=
NULL
)
{
pRsp
->
ahandle
=
pMsg
->
ahandle
;
rpcSendResponse
(
pRsp
);
free
(
pRsp
);
}
else
{
if
(
code
!=
0
)
code
=
terrno
;
SRpcMsg
rpcRsp
=
{.
handle
=
pMsg
->
handle
,
.
ahandle
=
pMsg
->
ahandle
,
.
code
=
code
};
rpcSendResponse
(
&
rpcRsp
);
if
(
pMsg
->
msgType
&
1u
)
{
if
(
pRsp
!=
NULL
)
{
pRsp
->
ahandle
=
pMsg
->
ahandle
;
rpcSendResponse
(
pRsp
);
free
(
pRsp
);
}
else
{
if
(
code
!=
0
)
code
=
terrno
;
SRpcMsg
rpcRsp
=
{.
handle
=
pMsg
->
handle
,
.
ahandle
=
pMsg
->
ahandle
,
.
code
=
code
};
rpcSendResponse
(
&
rpcRsp
);
}
}
rpcFreeCont
(
pMsg
->
pCont
);
...
...
source/dnode/mnode/impl/src/mnode.c
浏览文件 @
6ae9a421
...
...
@@ -366,14 +366,16 @@ SMnodeMsg *mndInitMsg(SMnode *pMnode, SRpcMsg *pRpcMsg) {
return
NULL
;
}
SRpcConnInfo
connInfo
=
{
0
};
if
((
pRpcMsg
->
msgType
&
1U
)
&&
rpcGetConnInfo
(
pRpcMsg
->
handle
,
&
connInfo
)
!=
0
)
{
taosFreeQitem
(
pMsg
);
terrno
=
TSDB_CODE_MND_NO_USER_FROM_CONN
;
mError
(
"failed to create msg since %s, app:%p RPC:%p"
,
terrstr
(),
pRpcMsg
->
ahandle
,
pRpcMsg
->
handle
);
return
NULL
;
if
(
pRpcMsg
->
msgType
!=
TDMT_MND_TRANS
)
{
SRpcConnInfo
connInfo
=
{
0
};
if
((
pRpcMsg
->
msgType
&
1U
)
&&
rpcGetConnInfo
(
pRpcMsg
->
handle
,
&
connInfo
)
!=
0
)
{
taosFreeQitem
(
pMsg
);
terrno
=
TSDB_CODE_MND_NO_USER_FROM_CONN
;
mError
(
"failed to create msg since %s, app:%p RPC:%p"
,
terrstr
(),
pRpcMsg
->
ahandle
,
pRpcMsg
->
handle
);
return
NULL
;
}
memcpy
(
pMsg
->
user
,
connInfo
.
user
,
TSDB_USER_LEN
);
}
memcpy
(
pMsg
->
user
,
connInfo
.
user
,
TSDB_USER_LEN
);
pMsg
->
pMnode
=
pMnode
;
pMsg
->
rpcMsg
=
*
pRpcMsg
;
...
...
source/dnode/mnode/impl/test/qnode/qnode.cpp
浏览文件 @
6ae9a421
...
...
@@ -50,7 +50,18 @@ TEST_F(MndTestQnode, 01_Show_Qnode) {
EXPECT_EQ
(
test
.
GetShowRows
(),
0
);
}
TEST_F
(
MndTestQnode
,
02
_Create_Qnode_Invalid_Id
)
{
TEST_F
(
MndTestQnode
,
02
_Create_Qnode
)
{
{
int32_t
contLen
=
sizeof
(
SMCreateQnodeReq
);
SMCreateQnodeReq
*
pReq
=
(
SMCreateQnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
2
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_MND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
TSDB_CODE_MND_DNODE_NOT_EXIST
);
}
{
int32_t
contLen
=
sizeof
(
SMCreateQnodeReq
);
...
...
@@ -63,11 +74,6 @@ TEST_F(MndTestQnode, 02_Create_Qnode_Invalid_Id) {
test
.
SendShowMetaMsg
(
TSDB_MGMT_TABLE_QNODE
,
""
);
CHECK_META
(
"show qnodes"
,
3
);
CHECK_SCHEMA
(
0
,
TSDB_DATA_TYPE_SMALLINT
,
2
,
"id"
);
CHECK_SCHEMA
(
1
,
TSDB_DATA_TYPE_BINARY
,
TSDB_EP_LEN
+
VARSTR_HEADER_SIZE
,
"endpoint"
);
CHECK_SCHEMA
(
2
,
TSDB_DATA_TYPE_TIMESTAMP
,
8
,
"create_time"
);
test
.
SendShowRetrieveMsg
();
EXPECT_EQ
(
test
.
GetShowRows
(),
1
);
...
...
@@ -75,14 +81,12 @@ TEST_F(MndTestQnode, 02_Create_Qnode_Invalid_Id) {
CheckBinary
(
"localhost:9014"
,
TSDB_EP_LEN
);
CheckTimestamp
();
}
}
TEST_F
(
MndTestQnode
,
03
_Create_Qnode_Invalid_Id
)
{
{
int32_t
contLen
=
sizeof
(
SMCreateQnodeReq
);
SMCreateQnodeReq
*
pReq
=
(
SMCreateQnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
2
);
pReq
->
dnodeId
=
htonl
(
1
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_MND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
...
...
source/libs/transport/src/rpcMain.c
浏览文件 @
6ae9a421
...
...
@@ -423,6 +423,8 @@ void rpcSendRequest(void *shandle, const SEpSet *pEpSet, SRpcMsg *pMsg, int64_t
}
void
rpcSendResponse
(
const
SRpcMsg
*
pRsp
)
{
if
(
pRsp
->
handle
==
NULL
)
return
;
int
msgLen
=
0
;
SRpcConn
*
pConn
=
(
SRpcConn
*
)
pRsp
->
handle
;
SRpcMsg
rpcMsg
=
*
pRsp
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录