Skip to content

Crashes when pidfile exist but process already dead #6

@Benys94

Description

@Benys94

Let call this zombie pidfile. I encoutered this issue when process was killed or somehow terminated but pidfile prevailed.
In this case when new process try to find process by PID from pidfile using cmd1 = psutil.Process(pid).cmdline()[0] it crashes on IndexError because no process is not found thus indexing over empty list = crash.

Proposed solution is to add IndexError into try-except block and then overwrite existing pidfile with current PID.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions