Skip to content

🐛 Fixes raises when stopping log fetching in dynamic-sidecar #7302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 6, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
"""
BackgroundLogFetcher:
Creates background task that
reads every line of a container's log and
posts it as a message to rabbit's log channel (logger)
BackgroundLogFetcher:
Creates background task that
reads every line of a container's log and
posts it as a message to rabbit's log channel (logger)
"""


import logging
from asyncio import CancelledError, Task, create_task
from collections.abc import AsyncGenerator, Callable, Coroutine
from contextlib import suppress
from typing import Any, AsyncGenerator, Callable, Coroutine, cast
from typing import Any, cast

from aiodocker import DockerError
from fastapi import FastAPI
Expand Down Expand Up @@ -85,7 +85,7 @@ async def stop_log_fetching(self, container_name: str) -> None:
return

task.cancel()
with suppress(CancelledError):
with suppress(CancelledError, TimeoutError):
await task

logger.debug("Logs fetching stopped for container '%s'", container_name)
Expand Down
Loading