Open Shpigford opened 13 years ago
I am seeing the same behavior. I am also running on Heroku Cedar in a Sinatra app.
Did you guys solve this? We are seeing the same issue in Heroku. I am guessing Clockwork is not able to exit gracefully when the dyno restarts. But can it be solved somehow?
I'm also experiencing the same issue, on Heroku in a Rails app. Been using the gem for months, then 2 days ago, it started getting a SignalException on the sleep command. It's happened 4 times total so far.
Here's what Heroku had to say
When Dynos are signal to shutdown, we first send SIGTERM, which your process should trap and perform any tasks required within 30 seconds before being forced to stop by the Dyno manager. I've had a quick look at your clock.rb, and it doesn't look like you're trapping any signals from the OS. If your application doesn't trap SIGTERM, it's likely that it will exit immediately, from whatever routine it's currently running, which looking at your stacktrace is during sleep (unsurprising for a clock process). You can gracefully shutdown by trapping the signal with something similar to:
# Trap `Kill `
Signal.trap("TERM") {
puts "\nShutting down gracefully..."
sleep 1
exit
}
I'm running clockwork on Heroku (Cedar) and I seem to randomly be getting a
SignalException: SIGTERM
error from clock work.Here's the backtrace:
And here's that rake task:
Then in my Procfile I have
clock: bundle exec rake clockwork:start