Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
7dc9c837
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看板
提交
7dc9c837
编写于
11月 08, 2021
作者:
T
TeslaZhao
提交者:
felixhjh
11月 10, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Merge pull request #1470 from felixhjh/dev_local
local predictor+web stop gracefully
上级
724bdcbc
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
11 deletion
+17
-11
python/paddle_serving_server/util.py
python/paddle_serving_server/util.py
+13
-10
python/paddle_serving_server/web_service.py
python/paddle_serving_server/web_service.py
+4
-1
未找到文件。
python/paddle_serving_server/util.py
浏览文件 @
7dc9c837
...
@@ -59,16 +59,19 @@ def kill_stop_process_by_pid(command : str, pid : int):
...
@@ -59,16 +59,19 @@ def kill_stop_process_by_pid(command : str, pid : int):
if
not
pid_is_exist
(
pid
):
if
not
pid_is_exist
(
pid
):
print
(
"Process [%s] has been stopped."
%
pid
)
print
(
"Process [%s] has been stopped."
%
pid
)
return
return
try
:
if
platform
.
system
()
==
"Windows"
:
if
command
==
"stop"
:
os
.
kill
(
pid
,
signal
.
SIGINT
)
os
.
killpg
(
pid
,
signal
.
SIGINT
)
else
:
elif
command
==
"kill"
:
try
:
os
.
killpg
(
pid
,
signal
.
SIGKILL
)
if
command
==
"stop"
:
except
ProcessLookupError
:
os
.
killpg
(
pid
,
signal
.
SIGINT
)
if
command
==
"stop"
:
elif
command
==
"kill"
:
os
.
kill
(
pid
,
signal
.
SIGINT
)
os
.
killpg
(
pid
,
signal
.
SIGKILL
)
elif
command
==
"kill"
:
except
ProcessLookupError
:
os
.
kill
(
pid
,
signal
.
SIGKILL
)
if
command
==
"stop"
:
os
.
kill
(
pid
,
signal
.
SIGINT
)
elif
command
==
"kill"
:
os
.
kill
(
pid
,
signal
.
SIGKILL
)
def
dump_pid_file
(
portList
,
model
):
def
dump_pid_file
(
portList
,
model
):
'''
'''
...
...
python/paddle_serving_server/web_service.py
浏览文件 @
7dc9c837
...
@@ -28,6 +28,7 @@ import os
...
@@ -28,6 +28,7 @@ import os
from
paddle_serving_server
import
pipeline
from
paddle_serving_server
import
pipeline
from
paddle_serving_server.pipeline
import
Op
from
paddle_serving_server.pipeline
import
Op
from
paddle_serving_server.serve
import
format_gpu_to_strlist
from
paddle_serving_server.serve
import
format_gpu_to_strlist
from
paddle_serving_server.util
import
dump_pid_file
def
port_is_available
(
port
):
def
port_is_available
(
port
):
...
@@ -260,7 +261,9 @@ class WebService(object):
...
@@ -260,7 +261,9 @@ class WebService(object):
self
.
gpu_multi_stream
=
gpu_multi_stream
self
.
gpu_multi_stream
=
gpu_multi_stream
self
.
op_num
=
op_num
self
.
op_num
=
op_num
self
.
op_max_batch
=
op_max_batch
self
.
op_max_batch
=
op_max_batch
# record port and pid info for stopping process
dump_pid_file
([
self
.
port
],
"web_service"
)
# if gpuid != None, we will use gpuid first.
# if gpuid != None, we will use gpuid first.
# otherwise, keep the self.gpus unchanged.
# otherwise, keep the self.gpus unchanged.
# maybe self.gpus is set by the Function set_gpus.
# maybe self.gpus is set by the Function set_gpus.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录