Issue #3013 has been updated by Ricky Zhou.

Markus Roberts wrote:
> * In my experimentation (also noted on one of the earlier tickets) select is 
> ineffective with pipes; they _always_ return as ready.  I have not 
> investigated the cause of this, but have confirmed it.

Are you sure?  Here is a test I tried on a Fedora 12 machine with 
ruby-1.8.6.383-4.fc12.x86_64 which shows select behaving as expected:

<pre>
[ri...@gamma ~]$ cat test.rb 
#!/usr/bin/ruby
r,w = IO.pipe
puts IO.select([r], nil, nil, 0.1)
w.puts('test')
puts IO.select([r], nil, nil, 0.1)
r.readpartial(4096)
puts IO.select([r], nil, nil, 0.1)
[ri...@gamma ~]$ ruby test.rb
nil
#<IO:0x7fb67f156f20>
nil
</pre>

> * I would not expect that trapping SIGPIPE (or anything else) in the code 
> before a Kernel.exec() would have the desired effect; if I am not mistaken 
> all this goes away when the process is replaced by the exec.

>From the execve manpage:
<pre>
* POSIX.1-2001 specifies that the dispositions of any signals that are ignored
  or set to the default are left unchanged.  POSIX.1-2001 specifies one
  exception:  if  SIGCHLD  is being ignored, then an implementation may leave
  the disposition unchanged or reset it to the default; Linux does the former.
</pre>

A test that I ran seemed to show that it did make a difference with the type of 
daemon that we discussed.  I'm also perfectly fine with letting those daemons 
die a well-deserved death though :-)

I'm reading through your latest patch now.  Glad that we're getting close to a 
solution for this :-)
----------------------------------------
Bug #3013: util.rb:execute broken on Ruby <1.8.3
http://projects.reductivelabs.com/issues/3013

Author: Ricky Zhou
Status: Ready for Testing
Priority: Urgent
Assigned to: Markus Roberts
Category: exec
Target version: 0.25.3
Affected version: 0.25.2
Keywords: 
Branch: http://github.com/MarkusQ/puppet/tree/ticket/0.25.x/3013


Apparently the patch in ticket #2731 introduced one more issue by using 
readpartial, which isn't available until ruby 1.8.3 (RHEL4 at least is 
affected).  I'm not sure how this is normally handled in ruby, but if the 
readpartial function is not available, the code should fall back to sysread 
(along with some code for handling EINTR).

Anybody with better ruby knowledge know how this should be done?


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account
--
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to