-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
JRuby 1.7.25/26 uninitialized constant Aws::Client::Errors #3920
Comments
Only since no one else has said anything on this, I'll add that I get the same results -- |
Just got bitten by this using JRuby 1.7.25 and AWS SDK gem 2.4.4. |
The backtrace:
|
Hmm, I had not seen this one come by. @eliaslevy Thanks for the updated stack trace! Poking around for a few minutes... |
I suspect this is a threading issue with autoloads. The Errors module referenced is accessed in error_handler.rb as So there's two possibilities I see:
The latter should be fixed, but it's possible thread-unsafeties have crept back into our loading. |
Well, I'm surprised. I came up with a test that I expected to work in MRI, but it fails. Perhaps I'm doing something wrong here: loop do
class Foo
if defined? Bar
remove_const :Bar
end
autoload :Bar, 'bar.rb'
end
go = false
threads = (1..100).map {Thread.new { 1 until go; Foo::Bar }}
go = true
threads.each(&:join)
end Both JRuby and MRI eventually raise NameError for missing |
I filed https://bugs.ruby-lang.org/issues/12688 to clarify thread-safety here. |
FWIW this occurs in a single threaded script. |
@eliaslevy I will try your exact example again. |
Well I can confirm this works fine in JRuby 9.1.3.0. I'll try 1.7 now.
|
Confirmed broken still on 1.7.25. I guess it wasn't a fluke! |
Yay! It works!
I will verify the patch and try to find tests for it. @kares do you remember if you added or enabled any tests for b216c5d? |
@headius I am not sure - it still isn't 100% good on 9K ... would put in the bare minimal that resolves this. |
Damn...it breaks another spec. https://travis-ci.org/jruby/jruby/builds/154864874 We will have to take a longer look at this. I will revert for now. |
Bump |
@JasonLunn Bumping because you need this fixed in JRuby 1.7? |
This issue definitely impacts our existing 1.7.x installs in production. While we have a 9K transition in the works, it is not complete. If this issue isn't going to get resolved in 1.7.x and I won't get a fix until I can upgrade to 9K, that is useful information too. In the meantime, with the issue open and slated for 1.7.27 release, I wanted to highlight the weeks of inactivity because of the popularity of the AWS-SDK. |
@JasonLunn Ok, thanks for clarifying that. We would like to fix it. The process involves reviewing and backporting a series of autoload improvements done by @kares and others. Just haven't gotten around to it :-\ |
Understood |
Bump - any closer to clarifying if the 1.7.x series will see a backport of this fix? |
@JasonLunn We do still want to backport this fix, but with 1.7 EOL at end of year our priorities are leaning toward 9k work. |
Ran into seemingly the same issue today, with a In my testing it doesn't really seem like a race condition, as I was able to reproduce the problem (seemingly) deterministically with the following snippet: autoload(:C, 'whatever')
p Object.const_set(:C, Module.new) Which prints A workaround is to require module Aws; module S3; end; end
require 'aws-sdk'
require 'aws-sdk-core/s3' But this obviously gets a bit tedious if you use several AWS services. EDIT: Added second require line, as it doesn't actually load S3 otherwise. |
@grddev are you running multiple threads by any chance? if not so, can we easily reproduce the isssue? |
@kares if it was unclear, I only need the two lines above to reproduce the issue. $ RBENV_VERSION=jruby-1.7.26 ruby -e 'autoload(:C, "whatever"); p Object.const_set(:C, Module.new)'
#<Module:0x1324409e>
$ RBENV_VERSION=jruby-1.7.23 ruby -e 'autoload(:C, "whatever"); p Object.const_set(:C, Module.new)'
C |
Ok I reverted the revert 02c988a with the only change as fixing const_defined? to be its original 1.9 impl. I believe the issue was that when we back-ported (or tried to) we left in the 2.x semantics which allows :: in const_defined?. @headius can you review this. I committed this because I was hoping someone @grddev @joshuaspence @JasonLunn @creddy @eliaslevy or @rtlong can try the original AWS use case and say whether this is fixed and perhaps the logstash guys can try things out with the broader commit I just landed: 45047a7. I have not actually see this go green yet but I am at the end of the work day and extremely optimistic :) |
DOH...bizarrely this is not working...False alarm. At least @grddev reduced case is not working. I am confused now why this was working before the revert now... |
I have occassionally seen the folling error in our Logstash error logs: ``` {"level":"ERROR","loggerName":"logstash.pipeline","timeMillis":1483972688181,"thread":"[main]<sqs","logEvent":{"message":"A plugin had an unrecoverable error. Will restart this plugin.\n Plugin: <LogStash::Inputs::SQS queue=>\"logstash\", region=>\"us-east-1\", threads=>4, id=>\"6ea8b94e902199fe214a76edafcbc1c24eee708e-3\", enable_metric=>true, codec=><LogStash::Codecs::JSON id=>\"json_d46ee53c-b664-49c2-a64f-c86a0d5b9599\", enable_metric=>true, charset=>\"UTF-8\">, polling_frequency=>20>\n Error: uninitialized constant Aws::Client::Errors"}} ``` This pull request applies to same monkey-patch as was done in logstash-plugins/logstash-output-sqs#20 in order to workaround jruby/jruby#3920. Fixes #35
@enebo So are we still targeting this for 1.7.27? As far as I know we don't have a working patch. |
@headius well it was a hope but I don't understand what is wrong so we might have to just accept we will never get this one on 1.7.x. |
1.7.x is EOL and this will not get fixed. Marking WONTFIX |
@headius We had a similar issue after updated Jruby from 1.7.21 to 1.7.27. It happened when we do But it's not always reproducible. Is this related to this issue? |
…rmenn> - Updating jruby to latest, multithreading issue in the old version would cause sdk failures jruby/jruby#3920 - Updating aws-sdk gem
This issue appears similar to #3645 except that this if for JRuby 1.7.25/26 vs 9.x
Environment
jruby -v
jruby 1.7.26-SNAPSHOT (1.9.3p551) 2016-05-24 5b83abb on Java HotSpot(TM) 64-Bit Server VM 1.8.0_74-b02 [darwin-x86
jruby 1.7.25 (1.9.3p551) 2016-04-13 867cb81 on Java HotSpot(TM) 64-Bit Server VM 1.8.0_74-b02 [darwin-x86_64]
uname -a
Darwin LAXM00618506A 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64
Expected Behavior
When a bucket object does not exist a
Aws::S3::Errors::NoSuchKey
error is raisedActual Behavior
A
NameError: uninitialized constant Aws::Client::Errors
is raisedThank you
The text was updated successfully, but these errors were encountered: