From: why the lucky stiff Date: 2003-08-07T14:09:47+09:00 Subject: Re: More on DRB & OpenSSL Nathaniel Talbott (nathaniel@NOSPAMtalbott.ws) wrote: > OK, I've tracked down my problem with DRb and OpenSSL a bit more; perhaps > someone can help me out now, as I'm quickly getting out of my league. Here > are test client and server scripts that will show the failure. To run them, > you'll need the latest DRb from ruby CVS For some reason the IO.select in openssl/buffering.rb is stalling. It looks to be a problem in ossl.c. /usr/local/lib/ruby/1.8/openssl/buffering.rb:31:in `select': Interrupt from /usr/local/lib/ruby/1.8/openssl/buffering.rb:31:in `fill_rbuff' from /usr/local/lib/ruby/1.8/openssl/buffering.rb:58:in `read' from /usr/local/lib/ruby/site_ruby/1.8/drb/drb.rb:108:in `load' You can solve the problem for now by providing IO.select with a timeout. I'm using 1.5 seconds below. (see following patch). It's stopping on an IO#select on the 482nd iteration hitting IO.select. This means that there is a current limitation in the OpenSSL module of 481 * BLOCK_SIZE. It looks to me like the Buffering module works fine, leaving the underlying sysread, IO functions in ossl.c under inspection. Oh, and this problem is affecting the client only. _why --- openssl.orig/lib/openssl/buffering.rb Wed Jul 23 10:11:30 2003 +++ openssl/lib/openssl/buffering.rb Wed Aug 6 23:06:59 2003 @@ -17,7 +17,7 @@ module Buffering include Enumerable attr_accessor :sync - BLOCK_SIZE = 1024 + BLOCK_SIZE = 4096 # # for reading. @@ -28,7 +28,7 @@ @rbuffer = "" unless defined? @rbuffer begin if self.respond_to?(:to_io) - IO.select([self.to_io], nil, nil) + IO.select([self.to_io], nil, nil, 1.5) end @rbuffer << self.sysread(BLOCK_SIZE) rescue EOFError