drbrain / net-http-persistent

Thread-safe persistent connections with Net::HTTP
http://seattlerb.rubyforge.org/net-http-persistent
339 stars 117 forks source link

on windows jruby: getrlimit not supported on this platform #129

Closed amo13 closed 2 years ago

amo13 commented 3 years ago

Following error comes up since 4.0.0. No error with 3.1.0

uri:classloader:/gems/net-http-persistent-4.0.0/lib/net/http/persistent.rb:167: 
warning: Process#getrlimit not supported on this platform
NoMethodError: undefined method `first' for 9223372036854775807:Integer
  <class:Persistent> at uri:classloader:/gems/net-http-persistent-4.0.0/lib/net/
http/persistent.rb:167
              <main> at uri:classloader:/gems/net-http-persistent-4.0.0/lib/net/
http/persistent.rb:149
             require at org/jruby/RubyKernel.java:974
             require at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rub
ygems/core_ext/kernel_require.rb:65
              <main> at uri:classloader:/gems/mechanize-2.7.7/lib/mechanize.rb:6
             require at org/jruby/RubyKernel.java:974
             require at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rub
ygems/core_ext/kernel_require.rb:130
              <main> at uri:classloader:/shoes-app/res/log.rb:19
             require at org/jruby/RubyKernel.java:974
    require_relative at org/jruby/RubyKernel.java:1002
              <main> at uri:classloader:/shoes-app/gui.rb:18
                load at org/jruby/RubyKernel.java:1009
              <main> at uri:classloader:/META-INF/main.rb:2
             require at org/jruby/RubyKernel.java:974
             require at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rub
ygems/core_ext/kernel_require.rb:117
              <main> at <script>:3
ERROR: org.jruby.embed.EvalFailedException: (NoMethodError) undefined method `fi
rst' for 9223372036854775807:Integer
deivid-rodriguez commented 3 years ago

In bundler, we vendor this library and we fixed it with this patch: https://github.com/rubygems/rubygems/pull/4138. But we haven't yet upstreamed the fix, I'd like to get a Windows CI running first: https://github.com/drbrain/net-http-persistent/pull/125.

deivid-rodriguez commented 3 years ago

Any chance rubygems/rubygems#4138 can be incorporated to this repo? I can also extract just that particular fix from #125 if preferred. It has been battle tested as part of bundler for a while now.