Skip to content

Hang caused by circus and psutil using conflicting methods to identify a process #1171

@TonyMay71

Description

@TonyMay71

resulting_pid, status = os.waitpid(pid, os.WNOHANG)

psutil uses a combination of PID and process creation time to identify a process. This means that an attempt to terminate a process by circus can fail if psutil notices that the creation times do not match. In this case psutil does not send a terminate signal to the process, but instead returns a NoSuchProcess exception.

The loop in watcher.reap_process() just uses the PID to identify a process. This means that the loop containing os.waitpid(pid, os.WNOHANG) can run forever as it waits for a process to terminate that has not been told to terminate.

Although the probability of this event occurring may seem small, this problem can be triggered by the psutil bug described in giampaolo/psutil#2031

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