Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with autoloading not working on some Rubies #70

Closed
dreilly1982 opened this issue Jul 29, 2015 · 1 comment
Closed

Issue with autoloading not working on some Rubies #70

dreilly1982 opened this issue Jul 29, 2015 · 1 comment

Comments

@dreilly1982
Copy link

The autoload in https://github.com/drbrain/net-http-persistent/blob/master/lib/net/http/persistent.rb#L17 seems to fail on some Rubies. While I have not been able to find an root cause of WHY, I do have some examples. This can be seen in rubygems/rubygems-mirror#36 and rubygems/bundler#3107. I have personally seen it on Ruby 2.2.2p95 with the following test:

irb(main):001:0> autoload :OpenSSL, 'openssl'
=> nil
irb(main):002:0> defined? OpenSSL::SSL
=> nil
irb(main):003:0> require 'openssl'
=> true
irb(main):004:0> defined? OpenSSL::SSL
=> "constant"

Where as on other machines (both different versions and 2.2.2p95) it works as intended:

:001 > autoload :OpenSSL, 'openssl'
 => nil 
 :002 > defined? OpenSSL::SSL
 => "constant" 

This is causing programs that rely on this Net::HTTP::Persistent to have to account for this behavior and forcibly load OpenSSL upfront, in much the same way as net/http/pipeline is loaded in https://github.com/drbrain/net-http-persistent/blob/master/lib/net/http/persistent.rb#L12-15

@drbrain
Copy link
Owner

drbrain commented May 1, 2020

I believe this has been addressed within ruby, if not a new bug should be filed there as the bug will occur with other users of net-http.

@drbrain drbrain closed this as completed May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants