Scale the workers after_commit #36

Merged
merged 1 commit into from Jan 21, 2013

3 participants

@davidakachaos

This will scale the workers after committing the changes
to the database. This will fix issue #34.

Main point of this is to relax the scaling to happen when
the jobs are in the database. This may also have an effect
on issue #33.

@davidakachaos davidakachaos Scale the workers after_commit
This will scale the workers after committing the changes
to the database. This will fix issue #34.

Main point of this is to relax the scaling to happen when
the jobs are in the database. This may also have an effect 
on issue #33.
87d0354
@pekeler

This would also work around random heroku api errors that so far prevent the delayed job record from being created (not good!). For example, two days ago I got a bunch of Heroku::API::Errors::ErrorWithResponse in my cedar app due to "503 Service Unavailable" in
vendor/bundle/ruby/1.9.1/gems/excon-0.16.10/lib/excon/connection.rb:292:in request_kernel'
vendor/bundle/ruby/1.9.1/gems/excon-0.16.10/lib/excon/connection.rb:103:in
request'
vendor/bundle/ruby/1.9.1/gems/heroku-api-0.3.7/lib/heroku/api.rb:74:in request'
vendor/bundle/ruby/1.9.1/gems/heroku-api-0.3.7/lib/heroku/api/processes.rb:43:in
post_ps_scale'
vendor/bundle/ruby/1.9.1/gems/workless-1.1.1/lib/workless/scalers/heroku_cedar.rb:10:in up'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:405:in
_run__933447152030012228__create__3893371580071494491__callbacks'

Same thing happened 4 days ago. And about a month ago I had a few Excon::Errors::SocketError due to "Connection refused" in
.bundle/gems/ruby/1.9.1/gems/excon-0.16.10/lib/excon/socket.rb:41:in connect'
.bundle/gems/ruby/1.9.1/gems/excon-0.16.10/lib/excon/socket.rb:41:in
block (2 levels) in connect'
/usr/ruby1.9.2/lib/ruby/1.9.1/timeout.rb:57:in timeout'
.bundle/gems/ruby/1.9.1/gems/excon-0.16.10/lib/excon/socket.rb:40:in
block in connect'
.bundle/gems/ruby/1.9.1/gems/excon-0.16.10/lib/excon/socket.rb:29:in each'
.bundle/gems/ruby/1.9.1/gems/excon-0.16.10/lib/excon/socket.rb:29:in
connect'
.bundle/gems/ruby/1.9.1/gems/excon-0.16.10/lib/excon/ssl_socket.rb:77:in connect'
.bundle/gems/ruby/1.9.1/gems/excon-0.16.10/lib/excon/socket.rb:16:in
initialize'
.bundle/gems/ruby/1.9.1/gems/excon-0.16.10/lib/excon/ssl_socket.rb:8:in initialize'
.bundle/gems/ruby/1.9.1/gems/excon-0.16.10/lib/excon/connection.rb:364:in
new'
.bundle/gems/ruby/1.9.1/gems/excon-0.16.10/lib/excon/connection.rb:364:in socket'
.bundle/gems/ruby/1.9.1/gems/excon-0.16.10/lib/excon/connection.rb:192:in
request_kernel'
.bundle/gems/ruby/1.9.1/gems/excon-0.16.10/lib/excon/connection.rb:103:in request'
.bundle/gems/ruby/1.9.1/gems/heroku-api-0.3.7/lib/heroku/api.rb:74:in
request'
.bundle/gems/ruby/1.9.1/gems/heroku-api-0.3.7/lib/heroku/api/processes.rb:9:in get_ps'
.bundle/gems/ruby/1.9.1/gems/workless-1.1.1/lib/workless/scalers/heroku_cedar.rb:18:in
workers'
.bundle/gems/ruby/1.9.1/gems/workless-1.1.1/lib/workless/scalers/heroku_cedar.rb:10:in up'
.bundle/gems/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:405:in
_run__2281942245487434652__create__4582579804209064128__callbacks'

So please merge and release this ASAP! Thanks.

@lostboy lostboy merged commit 59f065a into lostboy:master Jan 21, 2013

1 check passed

Details default The Travis build passed
@lostboy
Owner

Hi guys, ill get a gem release out this week for you

@davidakachaos

Thanks!

@davidakachaos davidakachaos deleted the davidakachaos:switch_to_after_commit branch Jan 22, 2013
@pekeler

Great!

@lostboy
Owner

There you go, let me know if it's all good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment