Skip to content

🐛Dask-sidecar: set 1 hour timeout when waiting for container logs #7472

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
Changes from all 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
Expand Up @@ -247,6 +247,11 @@ async def _parse_container_log_file( # noqa: PLR0913 # pylint: disable=too-many
)


_MINUTE: Final[int] = 60
_HOUR: Final[int] = 60 * _MINUTE
_AIODOCKER_LOGS_TIMEOUT_S: Final[int] = 1 * _HOUR


async def _parse_container_docker_logs(
*,
container: DockerContainer,
Expand All @@ -273,7 +278,11 @@ async def _parse_container_docker_logs(
async for log_line in cast(
AsyncGenerator[str, None],
container.log(
stdout=True, stderr=True, follow=True, timestamps=True
stdout=True,
stderr=True,
follow=True,
timestamps=True,
timeout=_AIODOCKER_LOGS_TIMEOUT_S,
),
):
log_msg_without_timestamp = log_line.split(" ", maxsplit=1)[1]
Expand Down
Loading