-
Notifications
You must be signed in to change notification settings - Fork 85
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
Fix multi-node list with parallel mode #206
Fix multi-node list with parallel mode #206
Conversation
… wait your own pids not any child from the parent
…nto parallel_conflict_with_diffy
merged in master branch to keep diffs limited to my code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intriguing. We're not using this in --parallel
mode internally (at least, not that I can find), so we haven't experienced this personally.. However, I think your fix looks good and I'll merge it in for 1-6-0 later this week!
Overview
This pull request fixes erroneously waited pids inside the OctocatalogDiff::Util::Parallel.run_tasks_parallel method.
I was testing parallel runs with a comma separated list of hosts in the -n option. It consistently failed if I ran without the --no-parallel flag with the following error:
breaks with multiple hosts with --parallel
works with --no-parallel
with fix (explicitly with --parallel)
I tracked it down to the fact that the usage of Process.wait(0) will reap any completed child in the context of the main ppid. Diffy apparently forks its differs and expects the child pids to be available to wait.
I thought that I had a good test in the parallel_rspec.rb file but I cant get it to work. The code however fixes all of my issues. If anybody is interested in taking a look at the tests and suggesting a better way, I would be grateful.
Checklist
rake
in your checkout directory, or review the CI job triggered whenever you push to a pull request.rake coverage:spec
or ignoring untestable sections of code with# :nocov
comments. If you need help getting to 100% coverage please ask; however, don't just submit code with no tests..gem
file into the vendor/cache directory./cc [related issues] [teams and individuals, making sure to mention why you're CC-ing them]