Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Commit

Permalink
Bug 957883 - git clone was getting stuck asking for a password in rem…
Browse files Browse the repository at this point in the history
…ote repository and no amount of redirecting or closing stdin prevented a deadlock.
  • Loading branch information
rmillner committed Apr 30, 2013
1 parent dd24ba9 commit ede5448
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions node/lib/openshift-origin-node/model/v1_cart_model.rb
Expand Up @@ -268,20 +268,21 @@ def handle_cartridge_action(cartridge, action, hook_dir, args)

def complete_process_gracefully(pid, stdin, stdout)
stdin.close
ignored, status = Process::waitpid2 pid
exitcode = status.exitstatus
# Do this to avoid cartridges that might hold open stdout
output = ""
begin
Timeout::timeout(5) do
Timeout::timeout(120) do
while (line = stdout.gets)
output << line
end
end
rescue Timeout::Error
logger.info("WARNING: stdout read timed out")
logger.info("WARNING: stdout read timed out, killing #{pid} and its child processes")
OpenShift::Utils::ShellExec.kill_process_tree(pid)
end

ignored, status = Process::waitpid2 pid
exitcode = status.exitstatus

if exitcode == 0
logger.info("(#{exitcode})\n------\n#{cleanpwd(output)}\n------)")
else
Expand Down

0 comments on commit ede5448

Please sign in to comment.