Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
38509793
M
milvus
项目概览
milvus
/
milvus
12 个月 前同步成功
通知
261
Star
22476
Fork
2472
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
38509793
编写于
11月 29, 2021
作者:
D
dragondriver
提交者:
GitHub
11月 29, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Show stack trace info when rpc fail (#12290)
Signed-off-by:
N
dragondriver
<
jiquan.long@zilliz.com
>
上级
243af903
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
117 addition
and
22 deletion
+117
-22
internal/distributed/datacoord/client/client.go
internal/distributed/datacoord/client/client.go
+5
-1
internal/distributed/datanode/client/client.go
internal/distributed/datanode/client/client.go
+3
-3
internal/distributed/indexcoord/client/client.go
internal/distributed/indexcoord/client/client.go
+3
-3
internal/distributed/indexnode/client/client.go
internal/distributed/indexnode/client/client.go
+3
-3
internal/distributed/proxy/client/client.go
internal/distributed/proxy/client/client.go
+3
-3
internal/distributed/querycoord/client/client.go
internal/distributed/querycoord/client/client.go
+3
-3
internal/distributed/querynode/client/client.go
internal/distributed/querynode/client/client.go
+3
-3
internal/distributed/rootcoord/client/client.go
internal/distributed/rootcoord/client/client.go
+3
-3
internal/util/trace/stack_trace.go
internal/util/trace/stack_trace.go
+44
-0
internal/util/trace/stack_trace_test.go
internal/util/trace/stack_trace_test.go
+47
-0
未找到文件。
internal/distributed/datacoord/client/client.go
浏览文件 @
38509793
...
...
@@ -202,7 +202,7 @@ func (c *Client) recall(caller func() (interface{}, error)) (interface{}, error)
return
ret
,
nil
}
if
err
==
context
.
Canceled
||
err
==
context
.
DeadlineExceeded
{
return
nil
,
err
return
nil
,
fmt
.
Errorf
(
"err: %s
\n
, %s"
,
err
.
Error
(),
trace
.
StackTrace
())
}
log
.
Debug
(
"DataCoord Client grpc error"
,
zap
.
Error
(
err
))
...
...
@@ -210,6 +210,10 @@ func (c *Client) recall(caller func() (interface{}, error)) (interface{}, error)
c
.
resetConnection
()
ret
,
err
=
caller
()
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"err: %s
\n
, %s"
,
err
.
Error
(),
trace
.
StackTrace
())
}
return
ret
,
err
}
...
...
internal/distributed/datanode/client/client.go
浏览文件 @
38509793
...
...
@@ -183,7 +183,7 @@ func (c *Client) recall(caller func() (interface{}, error)) (interface{}, error)
return
ret
,
nil
}
if
err
==
context
.
Canceled
||
err
==
context
.
DeadlineExceeded
{
return
nil
,
err
return
nil
,
fmt
.
Errorf
(
"err: %s
\n
, %s"
,
err
.
Error
(),
trace
.
StackTrace
())
}
log
.
Debug
(
"DataNode Client grpc error"
,
zap
.
Error
(
err
))
...
...
@@ -191,8 +191,8 @@ func (c *Client) recall(caller func() (interface{}, error)) (interface{}, error)
c
.
resetConnection
()
ret
,
err
=
caller
()
if
err
=
=
nil
{
return
ret
,
nil
if
err
!
=
nil
{
return
nil
,
fmt
.
Errorf
(
"err: %s
\n
, %s"
,
err
.
Error
(),
trace
.
StackTrace
())
}
return
ret
,
err
}
...
...
internal/distributed/indexcoord/client/client.go
浏览文件 @
38509793
...
...
@@ -189,7 +189,7 @@ func (c *Client) recall(caller func() (interface{}, error)) (interface{}, error)
return
ret
,
nil
}
if
err
==
context
.
Canceled
||
err
==
context
.
DeadlineExceeded
{
return
nil
,
err
return
nil
,
fmt
.
Errorf
(
"err: %s
\n
, %s"
,
err
.
Error
(),
trace
.
StackTrace
())
}
log
.
Debug
(
"IndexCoord Client grpc error"
,
zap
.
Error
(
err
))
...
...
@@ -197,8 +197,8 @@ func (c *Client) recall(caller func() (interface{}, error)) (interface{}, error)
c
.
resetConnection
()
ret
,
err
=
caller
()
if
err
=
=
nil
{
return
ret
,
nil
if
err
!
=
nil
{
return
nil
,
fmt
.
Errorf
(
"err: %s
\n
, %s"
,
err
.
Error
(),
trace
.
StackTrace
())
}
return
ret
,
err
}
...
...
internal/distributed/indexnode/client/client.go
浏览文件 @
38509793
...
...
@@ -179,15 +179,15 @@ func (c *Client) recall(caller func() (interface{}, error)) (interface{}, error)
return
ret
,
nil
}
if
err
==
context
.
Canceled
||
err
==
context
.
DeadlineExceeded
{
return
nil
,
err
return
nil
,
fmt
.
Errorf
(
"err: %s
\n
, %s"
,
err
.
Error
(),
trace
.
StackTrace
())
}
log
.
Debug
(
"IndexNode Client grpc error"
,
zap
.
Error
(
err
))
c
.
resetConnection
()
ret
,
err
=
caller
()
if
err
=
=
nil
{
return
ret
,
nil
if
err
!
=
nil
{
return
nil
,
fmt
.
Errorf
(
"err: %s
\n
, %s"
,
err
.
Error
(),
trace
.
StackTrace
())
}
return
ret
,
err
}
...
...
internal/distributed/proxy/client/client.go
浏览文件 @
38509793
...
...
@@ -180,15 +180,15 @@ func (c *Client) recall(caller func() (interface{}, error)) (interface{}, error)
return
ret
,
nil
}
if
err
==
context
.
Canceled
||
err
==
context
.
DeadlineExceeded
{
return
nil
,
err
return
nil
,
fmt
.
Errorf
(
"err: %s
\n
, %s"
,
err
.
Error
(),
trace
.
StackTrace
())
}
log
.
Debug
(
"Proxy Client grpc error"
,
zap
.
Error
(
err
))
c
.
resetConnection
()
ret
,
err
=
caller
()
if
err
=
=
nil
{
return
ret
,
nil
if
err
!
=
nil
{
return
nil
,
fmt
.
Errorf
(
"err: %s
\n
, %s"
,
err
.
Error
(),
trace
.
StackTrace
())
}
return
ret
,
err
}
...
...
internal/distributed/querycoord/client/client.go
浏览文件 @
38509793
...
...
@@ -204,15 +204,15 @@ func (c *Client) recall(caller func() (interface{}, error)) (interface{}, error)
return
ret
,
nil
}
if
err
==
context
.
Canceled
||
err
==
context
.
DeadlineExceeded
{
return
nil
,
err
return
nil
,
fmt
.
Errorf
(
"err: %s
\n
, %s"
,
err
.
Error
(),
trace
.
StackTrace
())
}
log
.
Debug
(
"QueryCoord Client grpc error"
,
zap
.
Error
(
err
))
c
.
resetConnection
()
ret
,
err
=
caller
()
if
err
=
=
nil
{
return
ret
,
nil
if
err
!
=
nil
{
return
nil
,
fmt
.
Errorf
(
"err: %s
\n
, %s"
,
err
.
Error
(),
trace
.
StackTrace
())
}
return
ret
,
err
}
...
...
internal/distributed/querynode/client/client.go
浏览文件 @
38509793
...
...
@@ -171,15 +171,15 @@ func (c *Client) recall(caller func() (interface{}, error)) (interface{}, error)
return
ret
,
nil
}
if
err
==
context
.
Canceled
||
err
==
context
.
DeadlineExceeded
{
return
nil
,
err
return
nil
,
fmt
.
Errorf
(
"err: %s
\n
, %s"
,
err
.
Error
(),
trace
.
StackTrace
())
}
log
.
Debug
(
"QueryNode Client grpc error"
,
zap
.
Error
(
err
))
c
.
resetConnection
()
ret
,
err
=
caller
()
if
err
=
=
nil
{
return
ret
,
nil
if
err
!
=
nil
{
return
nil
,
fmt
.
Errorf
(
"err: %s
\n
, %s"
,
err
.
Error
(),
trace
.
StackTrace
())
}
return
ret
,
err
}
...
...
internal/distributed/rootcoord/client/client.go
浏览文件 @
38509793
...
...
@@ -232,15 +232,15 @@ func (c *GrpcClient) recall(caller func() (interface{}, error)) (interface{}, er
return
ret
,
nil
}
if
err
==
context
.
Canceled
||
err
==
context
.
DeadlineExceeded
{
return
nil
,
err
return
nil
,
fmt
.
Errorf
(
"err: %s
\n
, %s"
,
err
.
Error
(),
trace
.
StackTrace
())
}
log
.
Debug
(
"RootCoord Client grpc error"
,
zap
.
Error
(
err
))
c
.
resetConnection
()
ret
,
err
=
caller
()
if
err
=
=
nil
{
return
ret
,
nil
if
err
!
=
nil
{
return
nil
,
fmt
.
Errorf
(
"err: %s
\n
, %s"
,
err
.
Error
(),
trace
.
StackTrace
())
}
return
ret
,
err
}
...
...
internal/util/trace/stack_trace.go
0 → 100644
浏览文件 @
38509793
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
// or implied. See the License for the specific language governing permissions and limitations under the License.
package
trace
import
(
"fmt"
"runtime"
)
const
numFuncsInStack
=
10
// StackTraceMsg returns the stack information, which numFuncs means how many functions do you want to show in the stack
// information.
func
StackTraceMsg
(
numFuncs
uint
)
string
{
pc
:=
make
([]
uintptr
,
numFuncs
)
n
:=
runtime
.
Callers
(
0
,
pc
)
frames
:=
runtime
.
CallersFrames
(
pc
[
:
n
])
ret
:=
""
for
{
frame
,
more
:=
frames
.
Next
()
ret
+=
fmt
.
Sprintf
(
"%s:%d %s
\n
"
,
frame
.
File
,
frame
.
Line
,
frame
.
Function
)
if
!
more
{
break
}
}
return
ret
}
// StackTrace returns the stack trace information.
func
StackTrace
()
string
{
return
StackTraceMsg
(
numFuncsInStack
)
}
internal/util/trace/stack_trace_test.go
0 → 100644
浏览文件 @
38509793
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
// or implied. See the License for the specific language governing permissions and limitations under the License.
package
trace
import
(
"fmt"
"testing"
)
func
TestStackTraceMsg
(
t
*
testing
.
T
)
{
fmt
.
Println
(
StackTraceMsg
(
1
))
fmt
.
Println
(
StackTraceMsg
(
5
))
fmt
.
Println
(
StackTraceMsg
(
10
))
func
()
{
fmt
.
Println
(
StackTraceMsg
(
10
))
}()
func
()
{
func
()
{
fmt
.
Println
(
StackTraceMsg
(
10
))
}()
}()
}
func
TestStackTrace
(
t
*
testing
.
T
)
{
fmt
.
Println
(
StackTrace
())
func
()
{
fmt
.
Println
(
StackTrace
())
}()
func
()
{
func
()
{
fmt
.
Println
(
StackTrace
())
}()
}()
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录