Skip to content

Command health checks can hang on inherited output pipes #92

Description

@Spikhalskiy

Issue

Command health checks attach logger writers to stdout and stderr. os/exec therefore copies through pipes, and Cmd.Run can remain blocked after the health-check process exits if a descendant inherited either pipe.

Proposed fix

A health-check attempt should complete within a bounded interval after its process exits. Setting a small Cmd.WaitDelay on command health checks prevents descendants from delaying service startup indefinitely.

A regression test can use a health-check command that starts a background child inheriting stdout, then exits.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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