Anyone here have any experience with long running rake tasks on
Heroku?
>From the Heroku documentation, it seems like when you have long
running processes, that rake tasks are the recommended way to handle
them. However, in my experience, whenever a rake task runs for a
while, say around 30 minutes, it almost invariably crashes or freezes.
So that I can resume my process, which steps through models in my
database and updates them, I have 'puts' statements in my rake task
that output what primary key they've processed through. Heroku doesn't
normally display puts statements from rake tasks while the tasks are
running.
When the rake task crashes, it'll usually die with the message:
! Internal server error
Other times it'll die with the message:
/var/lib/gems/1.8/gems/rest-client-1.4.2/lib/restclient/exceptions.rb:
76:in `http_body': undefined method `body' for nil:NilClass
(NoMethodError)
from /var/lib/gems/1.8/gems/heroku-1.10.4/lib/heroku/command.rb:33:in
`run'
from /var/lib/gems/1.8/gems/heroku-1.10.4/bin/heroku:13
from /var/lib/gems/1.8/bin/heroku:19:in `load'
from /var/lib/gems/1.8/bin/heroku:19
When the rake task freezes, it'll output all of the puts statements
suddenly, but not return at the command line. It'll hang around like
this for a while, sometimes hours, until one of the crash errors kills
it. While it's hung, it doesn't seem like it's processing any more
records.
None of these seem to leave anything in my logs to help me figure out
what's going on.
I already ran this by Heroku support, but they didn't really have any
input on this.
Has anyone else run long rake tasks? Have you run into these problems,
or managed to eliminate them?
--
You received this message because you are subscribed to the Google Groups
"Heroku" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/heroku?hl=en.