Skip to content

Commit

Permalink
fix(runner): Eliminate the exception during shutdown
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming committed May 4, 2023
1 parent 1e07ade commit 3effaab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions src/bentoml/_internal/marshal/dispatcher.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
from __future__ import annotations

import time
import typing as t
import asyncio
import logging
import collections
import functools
import logging
import time
import traceback
import collections
import typing as t

import attr
import numpy as np

from ..utils import cached_property
from ..utils.alg import TokenBucket


logger = logging.getLogger(__name__)


if t.TYPE_CHECKING:
from ..runner.utils import Params
from ..runner.container import Payload
from ..runner.utils import Params


class NonBlockSema:
Expand Down Expand Up @@ -235,7 +236,7 @@ async def train_optimizer(
info.enqueue_time = now
self._loop.create_task(self.outbound_call(inputs_info))
except asyncio.CancelledError:
return
raise
except Exception as e: # pylint: disable=broad-except
logger.error(traceback.format_exc(), exc_info=e)

Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/bento_server_http/tests/test_serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_http_server(bentoml_home: str):

server.stop()

timeout = 60
timeout = 10
start_time = time.time()
while time.time() - start_time < timeout:
retcode = server.process.poll()
Expand Down Expand Up @@ -48,7 +48,7 @@ def test_http_server_ctx(bentoml_home: str):

assert res == {"more_test": "and more json"}

timeout = 60
timeout = 10
start_time = time.time()
while time.time() - start_time < timeout:
retcode = server.process.poll()
Expand Down

0 comments on commit 3effaab

Please sign in to comment.