Sha256: 6c3609c9a22f81b068ad4a689441b87aacb6ea587a98c71f074563ae3c0c5c09

Contents?: true

Size: 1.14 KB

Versions: 58

Compression:

Stored size: 1.14 KB

Contents

# The ruby 2.0 stdlib includes the following changes
# to avoid "can't add a new key into hash during iteration" errors.
#   https://github.com/ruby/ruby/commit/3c491a92f6fbfecc065f7687c51c7d6d52a38883
#   https://github.com/ruby/ruby/commit/7b18633804c606e8bcccfbb44e7d7b795e777ea6
# However, these changes were not backported to the 1.9.x stdlib.
# These errors are causing intermittent errors in the tests (frequently in jruby),
# so we're applying those changes here. This is loaded by all rackups using WEBrick.
if RUBY_VERSION =~ /^1\.9/
  require 'webrick/utils'
  module WEBrick
    module Utils
      class TimeoutHandler
        def initialize
          @timeout_info = Hash.new
          Thread.start{
            while true
              now = Time.now
              @timeout_info.keys.each{|thread|
                ary = @timeout_info[thread]
                next unless ary
                ary.dup.each{|info|
                  time, exception = *info
                  interrupt(thread, info.object_id, exception) if time < now
                }
              }
              sleep 0.5
            end
          }
        end
      end
    end
  end
end

Version data entries

58 entries across 56 versions & 4 rubygems

Version Path
able-neo4j-1.0.0 vendor/bundle/jruby/1.9/gems/excon-0.45.4/tests/rackups/webrick_patch.rb
excon-0.49.0 tests/rackups/webrick_patch.rb
excon-0.48.0 tests/rackups/webrick_patch.rb
excon-0.47.0 tests/rackups/webrick_patch.rb
excon-0.46.0 tests/rackups/webrick_patch.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/excon-0.45.4/tests/rackups/webrick_patch.rb
excon-0.45.4 tests/rackups/webrick_patch.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/excon-0.45.3/tests/rackups/webrick_patch.rb
excon-0.45.3 tests/rackups/webrick_patch.rb
excon-0.45.2 tests/rackups/webrick_patch.rb
excon-0.45.1 tests/rackups/webrick_patch.rb
excon-0.45.0 tests/rackups/webrick_patch.rb
excon-0.44.4 tests/rackups/webrick_patch.rb
excon-0.44.3 tests/rackups/webrick_patch.rb
excon-0.44.2 tests/rackups/webrick_patch.rb
excon-0.44.1 tests/rackups/webrick_patch.rb
excon-0.44.0 tests/rackups/webrick_patch.rb
excon-0.43.0 tests/rackups/webrick_patch.rb
excon-0.42.1 tests/rackups/webrick_patch.rb
excon-0.42.0 tests/rackups/webrick_patch.rb