简体   繁体   中英

end of file reached EOFError (Databasedotcom + Rails + Heroku)

After much frustration trying to figure it out myself, I am reaching for SO guys (you!) to help me trace this formidable error:

Message: end of file reached EOFError Backtrace: ["/app/vendor/ruby-1.9.3/lib/ruby/1.9.1/openssl/buffering.rb:174:in `sysread_nonblock

Background : My App is a Rails 3 app hosted on Heroku and 100% back-end app. It uses Redis/Resque workers to process it's payload received from Salesforce using Chatter REST API.

Trouble : Unlike other similar errors of EOF in HTTPS/OpenSSL in Ruby, my error happens very random (since I can't yet predict when will this come up).

Usual Suspects : The error has been noticed quite frequently when I try to create 45 Resque workers, and try to sync data from 45 different Salesforce Chatter REST API connections all at once! It's so frequent that my processing fails 20% or more of the total and all due to this error.

Remedy Steps : I am using Databasedotcom gem which uses HTTPS and follows all the required steps to connect to create a sane HTTPS connection. So...

  • Use SSL set in HTTPS - checked
  • URI Encode - checked
  • Ruby 1.9.3 - checked
  • HTTP read timeout is set to 900 (15 minutes)
  • I retry this EOF error MAX of 30 times after sleeping 30 seconds before each retry! Still, it fails some of the data.

Any help here please?

Have you considered that Salesforce might not like so many connections at once from a single source and you are blocked by an DDOS-preventer?

Also, setting those long timeouts is quite useless. If the connection fails, drop it and reschedule a new one yourself. That is what Resque does fine, it will add up those waiting times if it keeps having problems...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM