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

Fix autoload race in Aws::EC2::* #264

Merged
merged 2 commits into from
Jul 20, 2016
Merged

Fix autoload race in Aws::EC2::* #264

merged 2 commits into from
Jul 20, 2016

Conversation

jkeiser
Copy link
Contributor

@jkeiser jkeiser commented Jul 19, 2016

by accessing the resources we need in driver initialize.

Tests for this are hard to write because they have to run separately. Here is the test I ran:

require "kitchen/driver/ec2"

ec2 = Kitchen::Driver::Ec2.new({})
threads = (1..1000).map do
  Thread.new do
    begin
      ec2.ec2.resource
    rescue
      STDERR.puts "Noooo #{$!}"
    end
  end
end
threads.each { |t| t.join }

If I run this before my patch, it prints out "Nooooo uninitialized constant Aws::EC2::Resource" multiple times. After the patch, it doesn't print it out.

@ksubrama
Copy link

👍

1 similar comment
@mwrock
Copy link
Member

mwrock commented Jul 19, 2016

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants