Skip to content

Revert "[NodeKiller] Schedule reboot and disconnect from node" #1140

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

Merged
merged 1 commit into from
Mar 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions clusterloader2/pkg/chaos/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,8 @@ func (k *NodeKiller) kill(nodes []v1.Node, stopCh <-chan struct{}) {
sleepInterrupt(time.Duration(k.config.SimulatedDowntime), stopCh)

klog.Infof("%s: Rebooting %q to repair the node", k, node.Name)
// Scheduling a reboot in one second, then disconnecting.
//
// Bash command explanation:
// 'nohup' - Making sure that end of SSH connection signal will not break sudo
// 'sudo' - Elevated priviliages, required by 'shutdown'
// 'shutdown' - Control machine power
// '-r' - Making 'shutdown' to reboot, instead of power-off
// '+1s' - Parameter to 'reboot', to wait 1 second before rebooting.
// '> /dev/null 2> /dev/null < /dev/null' - File descriptor redirect, all three I/O to avoid ssh hanging,
// see https://web.archive.org/web/20090429074212/http://www.openssh.com/faq.html#3.10
// '&' - Execute command in background, end without waiting for result
k.addRebootEvent(node.Name)
err = util.SSH("nohup sudo shutdown -r +1s > /dev/null 2> /dev/null < /dev/null &", &node, nil)
err = util.SSH("sudo reboot", &node, nil)
if err != nil {
klog.Errorf("%s: Error while rebooting node %q: %v", k, node.Name, err)
return
Expand Down