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

Detach bisect subprocesses to avoid making zombie processes #2739

Merged
merged 11 commits into from Aug 28, 2020

Commits on Aug 28, 2020

  1. Detach bisect process to avoid making zombie process

    If we do not `waitpid` or `detach` the bisect process become a zombie
    process.
    
    As mentionned in waitpid doc:
    > As long as a zombie is not removed from the system via a wait, it will consume a slot in the kernel process table, and if this table fills, it will not be possible to create further processes.
    
    `detach` is a good idea. From the Ruby doc:
    > Some operating systems retain the status of terminated child processes until the parent collects that status (normally using some variant of wait()). If the parent never collects this status, the child stays around as a zombie process. Process::detach prevents this by setting up a separate Ruby thread whose sole job is to reap the status of the process pid when it terminates. Use detach only when you do not intend to explicitly wait for the child to terminate.
    
    Related:
    - #2669
    - https://andrykonchin.github.io/rails/2019/12/25/deadlock-in-rspec.html
    benoittgt committed Aug 28, 2020
    Copy the full SHA
    91ef5a0 View commit details
    Browse the repository at this point in the history
  2. Add spec to prevent zombie status

    JonRowe authored and benoittgt committed Aug 28, 2020
    Copy the full SHA
    bc4e6a0 View commit details
    Browse the repository at this point in the history
  3. Changelog for #2739

    benoittgt committed Aug 28, 2020
    Copy the full SHA
    c67f462 View commit details
    Browse the repository at this point in the history
  4. Update Changelog.md

    JonRowe authored and benoittgt committed Aug 28, 2020
    Copy the full SHA
    f9da1b7 View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    6e622fa View commit details
    Browse the repository at this point in the history
  6. Update lib/rspec/core/bisect/fork_runner.rb

    Co-authored-by: Jon Rowe <hello@jonrowe.co.uk>
    benoittgt and JonRowe committed Aug 28, 2020
    Copy the full SHA
    9dfbc45 View commit details
    Browse the repository at this point in the history
  7. Copy the full SHA
    f1ca0bb View commit details
    Browse the repository at this point in the history
  8. Wrap =~ operator in brackets

    JonRowe authored and benoittgt committed Aug 28, 2020
    Copy the full SHA
    194cfe2 View commit details
    Browse the repository at this point in the history
  9. Copy the full SHA
    338c122 View commit details
    Browse the repository at this point in the history
  10. Copy the full SHA
    8ff81d0 View commit details
    Browse the repository at this point in the history
  11. Detect zombie processes

    benoittgt committed Aug 28, 2020
    Copy the full SHA
    07754b6 View commit details
    Browse the repository at this point in the history