diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2016-09-04 01:36:07 +0200 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2016-09-13 21:39:46 +0200 |
commit | c90174afcd586b7652e527f4506b07ab833c7a87 (patch) | |
tree | 114c26526ca984e632b456babca09f7a70d1d8eb /lib/gitlab/popen.rb | |
parent | 5fdd92df39030ba4297189a274b8055fbca4b580 (diff) | |
download | gitlab-ce-c90174afcd586b7652e527f4506b07ab833c7a87.tar.gz |
Fix Gitlab::Popen.popen thread-safety issuefix/gitlab-popen-thread-safety
Fixes #21842
Diffstat (limited to 'lib/gitlab/popen.rb')
-rw-r--r-- | lib/gitlab/popen.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/gitlab/popen.rb b/lib/gitlab/popen.rb index a0fd41161a5..cc74bb29087 100644 --- a/lib/gitlab/popen.rb +++ b/lib/gitlab/popen.rb @@ -18,18 +18,18 @@ module Gitlab FileUtils.mkdir_p(path) end - @cmd_output = "" - @cmd_status = 0 + cmd_output = "" + cmd_status = 0 Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr| yield(stdin) if block_given? stdin.close - @cmd_output << stdout.read - @cmd_output << stderr.read - @cmd_status = wait_thr.value.exitstatus + cmd_output << stdout.read + cmd_output << stderr.read + cmd_status = wait_thr.value.exitstatus end - [@cmd_output, @cmd_status] + [cmd_output, cmd_status] end end end |