Use sudo --non-interactive in at_exit to not hang#514
Use sudo --non-interactive in at_exit to not hang#514alanwu-shopify-inc wants to merge 1 commit into
sudo --non-interactive in at_exit to not hang#514Conversation
I noticed that ruby-bench hangs after a long enough benchmarking session. Turns out it was sudo trying to ask for with `quiet: true`. Since it may hang trying to ask for input during exit, let's use `--non-interactive` to opportunistically re-enable turbo boost.
9907a8c to
f53d4f1
Compare
|
It would leave turbo boost in a random state, depending on how long it took to run benchmarks, and run_benchmarks.rb would exit abnormally. At this point, can we just drop the |
All that is not new with this change, just that before this change it would also hang before exiting abnormally
It seems still useful for short runs, though. It's also nice to not have to figure out the command to restore turbo boost manually, or have a script ready that does it. |
|
Related to this, maybe we want to flip it and have |
|
What's the reason to use Though I agree hanging/waiting for input after a benchmark run is done is not great. Maybe a solution would be to spawn a subprocess that runs under sudo, so it keeps root permissions during the whole run and restores the state without needing to ask for the sudo password again. |
|
I'm not sure why it uses |
I'm not sure if I follow. It would not randomly give up on restoring the state or exit abnormally after the password input.
I think we want to drop (1) from the sudo command, whether we use On the other hand, I don't want to see (2) for this sudo command in most cases. However, if we can print it only when (we don't use |
I noticed that ruby-bench hangs after a long enough benchmarking session. Turns out it was sudo trying to ask for with
quiet: true. Since it may hang trying to ask for input during exit, let's use--non-interactiveto opportunistically re-enable turbo boost.