Merged
Conversation
2e1f8e3 to
a042402
Compare
a042402 to
85df12d
Compare
Contributor
Author
|
I filled the description of this PR and marked it as ready! |
This reverts commit e0cbc9c.
I believe the intention here is that the `OpenSSL` constant is autoloaded if not yet required. Just checking `defined?` on it won't do this.
We're still running into the `jruby` bug where the `OpenSSL` constant can't be found even if it should be there. My hypotheses is that this is happening because `net/http` still sets up an `autoload` for it. Since we don't control that code, we can't really remove that `autoload`, so I'm guessing doing the reserve (only `autoload` it and never explicitly require it) should do the trick as well?
I found this file, which was used in the past to simulate openssl not being available. It seems better than the current hack because it doesn't require renaming system files which is quite invasive.
85df12d to
3cfed75
Compare
Contributor
Author
|
I didn't see the jruby crashes again since the last time, but since this has other benefits I decided to go ahead with this. If it causes any issues, I'll revert it. |
openssl
deivid-rodriguez
added a commit
that referenced
this pull request
Dec 7, 2020
Try to fix openssl availability issues on jruby (cherry picked from commit 8fd5dee)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
This is a followup to #3809, and all the other PRs linked to that trying to deal with jruby load service issues.
To recap the issue, as first mentioned here, apparently on jruby sometimes autoloading a constant and making it available through
requirecan lead to weird concurrency issues that result in the constant not being available in the end.So the solution we've been proposing for these issue is to not do that, and either require or
autoload, but not both.Everything seems good now, except for
OpenSSLconstants, where we sometimes still get errors. In #3809 I unified our code to always require instead of autoloadingopenssl. However, the problem still reproduces on our latest code. See https://github.com/rubygems/rubygems/pull/3867/checks?check_run_id=1059447242, for example:After closer inspection, I noticed that the constant was still getting autoloaded
here: https://github.com/ruby/ruby/blob/93b78abd774109d1333d59eaf439b2e69ed0fe00/lib/net/http.rb#L25. And we can't really avoid that unless we stop requiringnet/httpand vendor it instead.So my approach was to instead of requiring
opensslalways, autoload it always. Other than potentially fixing the bug, this has two extra benefits:net-http-persistentgem.So I'd like to try this approach.
Tasks:
I will abide by the code of conduct.