Bug #721

select in windows accepts too many fd's

Added by Roger Pack over 6 years ago. Updated about 4 years ago.

[ruby-core:19728]
Status:Closed
Priority:Normal
Assignee:Usaku NAKAMURA
ruby -v: Backport:

Description

=begin
from http://redmine.ruby-lang.org/issues/show/670
the test files either hang or are uninterruptible, at least with 1.9 mingw SVN HEAD.

Note that you may need to
touch abc
before running the tests (once), and that sometimes they hang on accept, so you may need to do a ctrl+c to force it to progress.

Also on linux accept hangs when there are no available fd's--I'm not sure if that's expected or not.

With Linux and OS X and 1.9 the tests all work, besides that. Nice job.

Thanks!
-=R
=end

History

#1 Updated by Roger Pack over 6 years ago

=begin
There are two problems here, one being that select doesn't select on all fd's you pass, the other being that an accept call with no remaining fd's available will hang forever [uninterruptibly], in windows only, not linux.

Here's an example:

require 'socket'
require 'tempfile'
s = TCPServer.new '0.0.0.0', 4000
c = TCPSocket.new '127.0.0.1', 4000
fds = []
begin
loop { fds << Tempfile.new('test')}
rescue Exception
end
puts "accepting"
s.accept # should raise

=end

#2 Updated by Usaku NAKAMURA over 6 years ago

  • Category set to core
  • Assignee set to Usaku NAKAMURA
  • Target version set to 2.0.0

=begin

=end

#3 Updated by Usaku NAKAMURA over 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r20189.
=end

#4 Updated by Roger Pack over 6 years ago

=begin
did this also fix the "hanging when you pass select > 64 fds" aspect? would you like me to file a separate report for that?
Thanks!
-=R
=end

#5 Updated by Usaku NAKAMURA over 6 years ago

=begin
Hello,

In message " [Bug #721] select in windows accepts too many fd's"
on Nov.13,2008 03:58:06, redmine@ruby-lang.org wrote:

did this also fix the "hanging when you pass select > 64 fds" aspect? would you like me to file a separate report for that?

I solved only the problem that the reproduction script had shown.
I recommend to send another report for another problem :)

Regards,
--
U.Nakamura usa@garbagecollect.jp

=end

Also available in: Atom PDF