Several questions about container.logs / certain container hangs
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 1.7k
- Avg merge
- 13d 8h
- Merged PRs (30d)
- 2
Description
Hi,
I have several questions about container.logs. I'm using Python 3 with docker-py 2.5.1.
- What's the difference between
streamandfollow? It looks like if I specifystream, it will wait for more logs to come, which is essentiallyfollow. On the other hand, if I specifyfollow, then it has to bestream(how else will I get results?) - What's the return type. In the docs it says that
stringis returned if not streaming. However, I'm gettingbytes. I am gettingstrings (in the generator) when streaming at some time - I haven't been able to identify when it returnsstringvs.bytes, but I seem to be gettingstrings in aThreadPoolExecutorenvironment, andbytesif it's in its dedicated process.
Also, I can't get streaming logs for certain containers, consistently, at least if I start the stream as soon as the container is started. There's no error, but it simply hangs forever. (It take the container say 5 minutes to produce the first line) But there is log, and I can get it after it's produced. Unfortunately I'm not able to reproduce with trivial examples.
Any help is much appreciated. Thanks!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the container.logs entry point and the Python 3/docker-py 2.5.1 behavior described here. Compare stream and follow semantics, record whether non-streaming and streaming results are bytes or strings, and investigate the reported hang when streaming starts immediately after container startup. Done means the behavior is reproducible or explained, with the expected return types and option semantics made clear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100