Skip to content

hanging process with 100% CPU since 0.3.28Β #1348

@DanielRaapDev

Description

@DanielRaapDev

Using Mitogen 0.3.29 we observed some machines having 100% CPU usage on one core. It is a python process of Mitogen parent that hangs. When our pipelines run Ansible multiple times there may exist multiple instances of such a process increasing CPU load even more.

After some debugging we found that the loop of this code is running - never ending.

while PREAMBLE_COMPRESSED_LEN-len(C)and select.select([0],[],[]):C+=os.read(0,PREAMBLE_COMPRESSED_LEN-len(C))

A strace showed the process is calling this over and over again:

read(0, "", 18277)                      = 0
pselect6(1, [0], NULL, NULL, NULL, NULL) = 1 (in [0])
read(0, "", 18277)                      = 0
pselect6(1, [0], NULL, NULL, NULL, NULL) = 1 (in [0])

This was not happening on all machines nor for each run of our Ansible pipeline.

Workaround:
After reverting back to Mitogen 0.3.27 no more problems where seen.

I think this is related to the changes in #1307. Maybe because we don't use sudo logging?!

Setup:
We use SSH with an unprivileged user and use passwordless sudo to become root. We execute Ansible in a docker container running an execution environment. So each run uses exactly the same environment.

requirements.txt:

ansible-lint==25.9.2
ansible-navigator==25.9.0
jmespath==1.0.1
lxml==6.0.2
passlib==1.7.4
sarif-tools==3.0.5
mitogen==0.3.29

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-0.3Issues related to 0.3.X Mitogen releases

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions