diff --git a/karapace/kafka_rest_apis/__init__.py b/karapace/kafka_rest_apis/__init__.py index 3c8bfc67c..54929bdf1 100644 --- a/karapace/kafka_rest_apis/__init__.py +++ b/karapace/kafka_rest_apis/__init__.py @@ -72,6 +72,7 @@ def __init__(self, config: Config) -> None: self._idle_proxy_janitor_task: Optional[asyncio.Task] = None async def close(self) -> None: + log.info("Closing REST proxy application") if self._idle_proxy_janitor_task is not None: self._idle_proxy_janitor_task.cancel() self._idle_proxy_janitor_task = None diff --git a/karapace/rapu.py b/karapace/rapu.py index 2b9decf12..b02a29fb1 100644 --- a/karapace/rapu.py +++ b/karapace/rapu.py @@ -167,7 +167,7 @@ def __init__( self.app = self._create_aiohttp_application(config=config) self.log = logging.getLogger(self.app_name) self.stats = StatsClient(config=config) - self.app.on_cleanup.append(self.close_by_app) + self.app.on_shutdown.append(self.close_by_app) self.not_ready_handler = not_ready_handler def _create_aiohttp_application(self, *, config: Config) -> aiohttp.web.Application: