Created
March 23, 2013 01:12
-
-
Save bpot/5225920 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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