Skip to content

Commit

Permalink
Refs #21731 - revert using loop instead of process
Browse files Browse the repository at this point in the history
In e65c15a, the `process` call was replaced with `loop` for no obvious
reason. This change leads potentially for the commands to get stuck.

I've reproduced this by trying `sudo` effective method without `sudo`
being present on the system.
  • Loading branch information
iNecas committed May 11, 2018
1 parent e65c15a commit df481fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/foreman_remote_execution_core/script_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def run_async(command)
raise('Error initializing command') unless success
end
end
session.loop(0.1) { !run_started? }
session.process(0) { !run_started? }
return true
end

Expand Down Expand Up @@ -330,7 +330,7 @@ def run_sync(command, stdin = nil)
started = true
end
end
session.loop(0.1) { !started }
session.process(0) { !started }
# Closing the channel without sending any data gives us SIGPIPE
channel.close unless stdin.nil?
channel.wait
Expand Down

0 comments on commit df481fc

Please sign in to comment.