Project

General

Profile

Actions

Bug #5487

closed

popen3 + timeout regression in ruby 1.9

Added by wmorgan (William Morgan) over 12 years ago. Updated almost 10 years ago.

Status:
Rejected
Target version:
-
ruby -v:
1.9.2p290
Backport:
[ruby-core:40419]

Description

Wrapping Open3.popen3 in a Timeout::timeout block used to work in Ruby 1.8, but doesn't work in 1.9:

w@masanjin:~$ cat timeout.rb
require 'timeout'
require 'open3'

Timeout::timeout(1) { Open3.popen3("sleep 100 && echo hi") { |i, o, e| e.read } }
w@masanjin:~$ /usr/bin/ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]
w@masanjin:~$ /usr/bin/ruby timeout.rb
/usr/lib/ruby/1.8/timeout.rb:60: execution expired (Timeout::Error)
from /usr/lib/ruby/1.8/open3.rb:86:in `popen3'
from timeout.rb:4
from timeout.rb:4

w@masanjin:~$ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
w@masanjin:~$ ruby timeout.rb
[sleeps forever]

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0