Skip to content

Commit 539e733

Browse files
committed
fix again
1 parent 8d29866 commit 539e733

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

lightllm/server/visualserver/manager.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,13 @@ async def loop_for_netio_req(self):
191191

192192
def clean_up(self):
193193
for proc in getattr(self, "model_procs", []):
194-
if proc.is_alive():
195-
logger.info(f"Killing VIT model process {proc.pid}")
196-
proc.kill()
197-
proc.join(timeout=5)
194+
try:
195+
if proc.is_alive():
196+
logger.info(f"Killing VIT model process {proc.pid}")
197+
proc.kill()
198+
proc.join(timeout=5)
199+
except (ProcessLookupError, OSError):
200+
pass
198201

199202

200203
def start_visual_process(args, pipe_writer):

lightllm/server/visualserver/visual_only_manager.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,13 @@ async def infer_images(self, dp_index: int, images, events):
134134

135135
def clean_up(self):
136136
for proc in getattr(self, "model_procs", []):
137-
if proc.is_alive():
138-
logger.info(f"Killing VIT model process {proc.pid}")
139-
proc.kill()
140-
proc.join(timeout=5)
137+
try:
138+
if proc.is_alive():
139+
logger.info(f"Killing VIT model process {proc.pid}")
140+
proc.kill()
141+
proc.join(timeout=5)
142+
except (ProcessLookupError, OSError):
143+
pass
141144

142145
def exposed_remote_infer_images(self, images: List[ImageItem], ref_event: threading.Event):
143146
try:

0 commit comments

Comments
 (0)