Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Tools
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

Standup 9/29/2010: ActiveRecord finders strings vs ints; Paperclip and S3 timeouts

Joseph Palermo
Wednesday, September 29, 2010

Ask for Help

“S3 is giving us 400 timeout responses on every first upload for a request. All subsequent uploads for the same request seem to work fine.”

This turned out to be a bug in the HEAD version of Paperclip. They added a fingerprint method that creates a MD5 hash out of the original file, but the method forgets to rewind the original file when done. So S3 times out while waiting for data, but then rewinds the file before trying again. So it does ultimately get uploaded, but it was leading to ~10 second delays in the middle of the request.

Interesting Things

  • Be careful when doing MyModel.find_by_column-that-is-a-string in ActiveRecord. If you pass it an integer it won’t do a type conversion and will pass it down to SQL as an unquoted integer. MySQL will then not use any indexes you have on that column. This is with Rails 2.3.x and MySQL 5.0.x
  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Add New Comment Cancel reply

Your email address will not be published.

Joseph Palermo

Joseph Palermo
San Francisco

Recent Posts

  • Rails Associations With Multiple Foreign Keys
  • Why Pivots don’t do their best work at night
  • [Standup][SF] 08/28/12: They at least strongly dislike each other
Subscribe to Joseph's Feed

Author Topics

activerecord (1)
associations (1)
ruby on rails (3)
agile (18)
named_scope (1)
bug (1)
performance (1)
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Tools
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >