Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PUP-11897) Fix excessive cpu usage after EOF from an exec #9105

Closed
wants to merge 3 commits into from

Commits on Jun 22, 2023

  1. (PUP-11897) Handle EOF in order to avoid busy-loop

    When EOF is reached, calls to IO.select() will return immediately,
    resulting in puppet executing the loop without any internal blocking.
    This causes up to 100% usage of a CPU core until the child finishes.
    
    If the child does its own stdout/stderr redirection before a long
    operation, for example, this can result in much wasted CPU usage.
    
    There is no need to execute the body of the loop after EOF is reached,
    so switch the Process.waitpid2 flags to block.
    bugfood committed Jun 22, 2023
    Configuration menu
    Copy the full SHA
    4f35fd2 View commit details
    Browse the repository at this point in the history

Commits on Sep 7, 2023

  1. (PUP-11897) Add integration test for excessive cpu time for EOF in exec

    This adds testing for 4f35fd2 which fixes excessive core usage
    when an exec has received an EOF.
    tvpartytonight committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    9708d4f View commit details
    Browse the repository at this point in the history
  2. (PUP-11897) Add additional mocking to the execution spec

    With the change in 4f35fd2, the execution tests need to have
    mocked out the an addtional call to `waitpid2` that has the
    flag set to zero.
    tvpartytonight committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    edd2e47 View commit details
    Browse the repository at this point in the history