Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: JRuby 1.5.1
-
Fix Version/s: None
-
Component/s: Ruby 1.8.7
-
Labels:None
-
Environment:Hidejruby 1.5.1
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)
Ubuntu Linux batch03 2.6.32-305-ec2 #9-Ubuntu SMP Thu Apr 15 08:05:38 UTC 2010 x86_64 GNU/Linux
or
jruby 1.5.1
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04-248-9M3125)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01-101, mixed mode)
OSX 10.5.8 or OSX 10.6
Showjruby 1.5.1 java version "1.6.0_20" Java(TM) SE Runtime Environment (build 1.6.0_20-b02) Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode) Ubuntu Linux batch03 2.6.32-305-ec2 #9-Ubuntu SMP Thu Apr 15 08:05:38 UTC 2010 x86_64 GNU/Linux or jruby 1.5.1 java version "1.6.0_17" Java(TM) SE Runtime Environment (build 1.6.0_17-b04-248-9M3125) Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01-101, mixed mode) OSX 10.5.8 or OSX 10.6
-
Testcase included:yes
-
Number of attachments :
Description
When connecting to imap over ssl, jruby eventually throws an error
OpenSSL::SSL::SSLError: Too many open files
from /Users/karl/.rvm/rubies/jruby-1.5.1/lib/ruby/1.8/net/imap.rb:904:in `initialize'
from (irb):4:in `new'
from (irb):4
The following code snippet reproduces the problem:
require 'net/imap'
10000.times.each do |i|
puts "connection #
"
imap = Net::IMAP.new('imap.gmail.com', 993, true)
imap.disconnect
end
This problem does not occur on MRI or REE.
thx
Issue Links
- duplicates
-
JRUBY-5018
SSLSocket holds selectors, keys, preventing quick cleanup of resources when dereferenced
-
I modified the script as follows:
10000.times.each do |i|
{i}"puts "connection #
imap = Net::IMAP.new('imap.gmail.com', 993, true)
imap.disconnect
`lsof > imap-#{i}
.txt` if (i % 1000) == 0
end
Attaching the output.