Skip to content

@bpot /ssl_hang.rb
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
# Attempt to reproduce SSL_shutdown() hang. http://bugs.ruby-lang.org/issues/7584
require 'net/http'
require 'uri'
20.times do
Thread.new {
loop do
# Sorry google!
uri = URI.parse("https://www.google.com/")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.start
sleep rand(10) * 0.1
http.finish if rand(2) == 1
sleep rand(10) * 0.1
# http://www.youtube.com/watch?v=ddUbsWnEVXM
puts "AND I KEEP GOING: #{Time.now} #{GC.count}"
end
}
end
5.times do
Thread.new {
loop do
GC.start
sleep rand(10) * 0.1
end
}
end
sleep 600
puts "DONE, failed to reproduce"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.