Anyone else experiencing aws-s3 timeout problems when looking for nonexistant keys? S3Object.exist? and S3Object.request(:head, ..)

Has anyone been having problems with aws-s3's S3Object.exists?, or S3Object.request(:head, ...) timing out when passed keys which do not exist? (I'm running aws-s3 0.6.2, ruby 1.9.2). Using S3Object.find('thenonexistantkey', bucket) raises a NoSuchKey exception as expected. Is this an issue on amazon's side?

Answers


aws-s3 gem does not set the timeout to reasonable values

You can do it by monkeypatching its create_connection method

Create a file config/initializers/aws_s3_connection_monkey_patch.rb:

# Sets the timeouts to appropriate values for S3
module AWS
  module S3
    class Connection #:nodoc:
      private
      def create_connection_with_timeout_settings
        http = create_connection_without_timeout_settings
        http.open_timeout = 1
        http.read_timeout = 5
        http
      end
      alias_method_chain :create_connection, :timeout_settings
    end
  end
end

Need Your Help

MVC2: How can I read control values for an action link?

asp.net-mvc-2 model actionlink formcollection

I'm passing in some model information to an ActionLink, but I'd also like to provide the action with the values of some inputs on the page. For example, if I had something like this:

get JComboBox Item Value

java swing label jcombobox

I've got this JComboBox where the items are the results of a query. What I'm trying to do here is to set a label and a value to each item. The problem is that when I want to get the value of the item

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.