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

Avoid gathering all data with sysctl which seems to hang #1259

Merged
merged 1 commit into from
Sep 27, 2018
Merged

Conversation

tas50
Copy link
Contributor

@tas50 tas50 commented Sep 27, 2018

While it works fine for me @bdausses was seeing chef-client hang
forever on macos 10.14. It turns out running sysctl -a on his VM was causing the
system to hang. Besides this crash it actually takes about 2x longer to
gather the additional data, which we never use. This shaves a whole 0.033255 seconds from
the total runtime of Ohai.

Signed-off-by: Tim Smith [email protected]

@tas50 tas50 requested a review from a team September 27, 2018 05:34
Copy link
Contributor

@tyler-ball tyler-ball left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 after fixing the test

@@ -78,7 +78,7 @@
CTL

allow(@plugin).to receive(:collect_os).and_return(:darwin)
allow(@plugin).to receive(:shell_out).with("sysctl -a").and_return(mock_shell_out(0, @stdout, ""))
allow(@plugin).to receive(:shell_out).with("sysctl cpu machdep").and_return(mock_shell_out(0, @stdout, ""))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code runs sysctl hw and the test expects sysctl cpu - looks like the source of the failures

@tyler-ball
Copy link
Contributor

@tas50 Updated the spec to match sysctl hw machdep in expectation

While it works fine for me @bdausses was seeing chef-client hang
forever. It turns out running sysctl -a on his host was causing the
system to hang. Besides this crash it actually takes about 2x longer to
gather the additional data. This shaves a whole 0.033255 seconds from
the total runtime.

Signed-off-by: Tim Smith <[email protected]>
@tas50 tas50 merged commit 9073d82 into master Sep 27, 2018
@chef-ci chef-ci deleted the sysctl_less branch September 27, 2018 15:47
@lock
Copy link

lock bot commented Jan 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants