docker / docker/docker-py

When the container calls the get_archive method, 100% CPU usage occurs in the new version of v3.3.0

Open
#2,053 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/question
Dominant language
Python
Stars
7.2k
Forks
1.7k
Avg merge
13d 8h
Merged PRs (30d)
2

Description

Hi, I used to use the container's get_archive method when I used version v2.7.0
log_init = y.get_archive(service_log_path) log_str = str(log_init[0].data, encoding="utf-8")
Later, when I used v.3.3.0, I found there was no data method, so I tried other methods
log_init = y.get_archive(service_log_path) log_str = '' for i in log_init[0]: log_str = log_str + str(i, encoding="utf-8")
But the consequence of what I did was that if I extracted an 8M text log, python3 would be 100% CPU utilization. And very slowly, I don't know what he did with it. But I won't have this problem with v2.7.0. It's almost always done in 2 seconds.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the container's get_archive method and reproduce the reported behavior using the v2.7.0 and v3.3.0 examples against an 8M text log. Compare CPU usage, completion time, and returned data handling; done means log extraction completes without the reported 100% Python CPU usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.