Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
6bd0c51e
S
Serving
项目概览
PaddlePaddle
/
Serving
大约 1 年 前同步成功
通知
186
Star
833
Fork
253
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
105
列表
看板
标记
里程碑
合并请求
10
Wiki
2
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Serving
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
105
Issue
105
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
2
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6bd0c51e
编写于
11月 24, 2021
作者:
F
felixhjh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify init and error msg, import problem
上级
2d9abbc1
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
13 addition
and
10 deletion
+13
-10
python/pipeline/dag.py
python/pipeline/dag.py
+3
-2
python/pipeline/error_catch.py
python/pipeline/error_catch.py
+6
-5
python/pipeline/operator.py
python/pipeline/operator.py
+4
-3
未找到文件。
python/pipeline/dag.py
浏览文件 @
6bd0c51e
...
...
@@ -29,8 +29,9 @@ import json
from
.error_catch
import
ErrorCatch
,
CustomException
,
CustomExceptionCode
,
ParamChecker
,
ParamVerify
from
.operator
import
Op
,
RequestOp
,
ResponseOp
,
VirtualOp
from
.channel
import
(
ThreadChannel
,
ProcessChannel
,
ChannelData
,
ChannelDataErrcode
,
ChannelDataType
,
ChannelStopError
,
ProductErrCode
)
ChannelDataType
,
ChannelStopError
)
from
.error_catch
import
ProductErrCode
from
.error_catch
import
CustomExceptionCode
as
ChannelDataErrcode
from
.profiler
import
TimeProfiler
,
PerformanceTracer
from
.util
import
NameGenerator
,
ThreadIdGenerator
,
PipelineProcSyncManager
from
.proto
import
pipeline_service_pb2
...
...
python/pipeline/error_catch.py
浏览文件 @
6bd0c51e
...
...
@@ -48,8 +48,9 @@ class CustomExceptionCode(enum.Enum):
class
ProductErrCode
(
enum
.
Enum
):
"""
ProductErrCode is a base class for recording business error code.
product developers overwrites this class and extend more error codes.
ProductErrCode is to record business error codes.
the ProductErrCode number ranges from 51 to 99
product developers can directly add error code into this class.
"""
pass
...
...
@@ -105,13 +106,13 @@ class ErrorCatch():
_LOGGER
.
error
(
"
\n
Log_id: {}
\n
{}Classname: {}
\n
FunctionName: {}
\n
Args: {}"
.
format
(
log_id
,
traceback
.
format_exc
(),
func
.
__qualname__
,
func
.
__name__
,
args
))
split_list
=
re
.
split
(
"
\n
|
\t
|:"
,
str
(
e
))
resp
.
err_no
=
int
(
split_list
[
3
])
resp
.
err_msg
=
"Log_id: {}
ErrNo: {} Error_msg: {} ClassName: {} FunctionName: {}"
.
format
(
log_id
,
resp
.
err_no
,
split_list
[
9
],
func
.
__qualname__
,
func
.
__name__
)
resp
.
err_msg
=
"Log_id: {}
Raise_msg: {} ClassName: {} FunctionName: {}"
.
format
(
log_id
,
split_list
[
9
],
func
.
__qualname__
,
func
.
__name__
)
is_send_to_user
=
split_list
[
-
1
].
replace
(
" "
,
""
)
if
is_send_to_user
==
"True"
:
return
(
None
,
resp
)
else
:
print
(
"Erro_Num: {} {}"
.
format
(
resp
.
err_no
,
resp
.
err_msg
))
print
(
"Init error occurs. For detailed information
, Please look up log
by log_id."
)
print
(
"Init error occurs. For detailed information
. Please look up pipeline.log.wf in PipelineServingLogs
by log_id."
)
kill_stop_process_by_pid
(
"kill"
,
os
.
getpgid
(
os
.
getpid
()))
except
Exception
as
e
:
if
"log_id"
in
kw
.
keys
():
...
...
@@ -123,7 +124,7 @@ class ErrorCatch():
resp
=
pipeline_service_pb2
.
Response
()
_LOGGER
.
error
(
"
\n
Log_id: {}
\n
{}Classname: {}
\n
FunctionName: {}
\n
Args: {}"
.
format
(
log_id
,
traceback
.
format_exc
(),
func
.
__qualname__
,
func
.
__name__
,
args
))
resp
.
err_no
=
CustomExceptionCode
.
UNKNOW
.
value
resp
.
err_msg
=
"Log_id: {}
ErrNo: {} Error_msg: {} ClassName: {} FunctionName: {}"
.
format
(
log_id
,
resp
.
err_no
,
str
(
e
).
replace
(
"
\'
"
,
""
),
func
.
__qualname__
,
func
.
__name__
)
resp
.
err_msg
=
"Log_id: {}
Raise_msg: {} ClassName: {} FunctionName: {}"
.
format
(
log_id
,
str
(
e
).
replace
(
"
\'
"
,
""
),
func
.
__qualname__
,
func
.
__name__
)
return
(
None
,
resp
)
else
:
resp
=
pipeline_service_pb2
.
Response
()
...
...
python/pipeline/operator.py
浏览文件 @
6bd0c51e
...
...
@@ -36,9 +36,10 @@ else:
from
.error_catch
import
ErrorCatch
,
CustomException
,
CustomExceptionCode
from
.proto
import
pipeline_service_pb2
from
.channel
import
(
ThreadChannel
,
ProcessChannel
,
ChannelDataErrcode
,
ChannelData
,
ChannelDataType
,
ChannelStopError
,
ChannelTimeoutError
,
ProductErrCode
)
from
.channel
import
(
ThreadChannel
,
ProcessChannel
,
ChannelData
,
ChannelDataType
,
ChannelStopError
,
ChannelTimeoutError
)
from
.error_catch
import
ProductErrCode
from
.error_catch
import
CustomExceptionCode
as
ChannelDataErrcode
from
.util
import
NameGenerator
from
.profiler
import
UnsafeTimeProfiler
as
TimeProfiler
from
.
import
local_service_handler
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录