8000 DockerContainer.log() times out after 300 seconds / 5 minutes of streaming · Issue #901 · aio-libs/aiodocker · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
DockerContainer.log() 8994 times out after 300 seconds / 5 minutes of streaming #901
Open
@sauladam

Description

@sauladam

Long story short

Streaming logs for a container works fine for exactly 5 minutes before the process times out. This seems to be an HTTP timeout, probably a default value in aiohttp.

  • Expected behaviour: Stream logs until container goes away.
  • Actual behaviour: Only streams for 5 minutes even though the container is still running.

How to reproduce

docker = Docker()
container = await docker.containers.get(container_id)
logs_stream = container.log(stdout=True, stderr=True, follow=True)

async for log in logs_stream:
    print(log)

Let it cook for 5 minutes.

Sidenote:

Subscribing to docker events works fine.

I also went sourcediving and found the logs property on the DockerContainer class which is a DockerLog instance.

I then tried to do the same as with docker events:

subscription = container.logs.subscribe()
asyncio.create_task(container.logs.run(timestamps=True))

while True:
    log = await subscription.get()

    if log is None:
        break
    print(log)

But this also times out after 5 minutes.

Your environment

Python 3.12.6 (inside Docker container from python:3.12-alpine3.19)
aiodocker==0.23.0
aiohttp==3.9.5 (clamped because of an issue with newer versions)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0