rapns
rapns copied to clipboard
fatal: deadlock detected
I implemented the push notifications and GCM notifications using this gem working great.
@ileitch
But i came across one strange issue. Sometimes my rails server goes into deadlock state.
Any Help on this will be great
I got the following log.
It cames when there is noting to push and we call "Rapns.push"
Log= >
Rapns::Notification Load (0.6ms) SELECT rapns_notifications
.* FROM rapns_notifications
WHERE (delivered = 0 AND failed = 0 AND (deliver_after IS NULL OR deliver_after < '2014-01-22 17:30:48')) AND (app_id IN (1,2,3,4))
=> {}
1.9.3-p484 :005 > Rapns.push
(0.3ms) SELECT COUNT() FROM rapns_apps
Rapns::App Load (0.2ms) SELECT rapns_apps
. FROM rapns_apps
Rapns::Notification Load (0.6ms) SELECT rapns_notifications
.* FROM rapns_notifications
WHERE (delivered = 0 AND failed = 0 AND (deliver_after IS NULL OR deliver_after < '2014-01-22 17:30:55')) AND (app_id IN (1,2,3,4))
fatal: deadlock detected
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p484/gems/rapns-3.3.2/lib/rapns/daemon/delivery_handler.rb:21:in join' from /home/ubuntu/.rvm/gems/ruby-1.9.3-p484/gems/rapns-3.3.2/lib/rapns/daemon/delivery_handler.rb:21:in
stop'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p484/gems/rapns-3.3.2/lib/rapns/daemon/app_runner.rb:81:in map' from /home/ubuntu/.rvm/gems/ruby-1.9.3-p484/gems/rapns-3.3.2/lib/rapns/daemon/app_runner.rb:81:in
stop'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p484/gems/rapns-3.3.2/lib/rapns/daemon/app_runner.rb:46:in map' from /home/ubuntu/.rvm/gems/ruby-1.9.3-p484/gems/rapns-3.3.2/lib/rapns/daemon/app_runner.rb:46:in
stop'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p484/gems/rapns-3.3.2/lib/rapns/push.rb:15:in push' from (irb):5 from /home/ubuntu/.rvm/gems/ruby-1.9.3-p484/gems/railties-3.2.6/lib/rails/commands/console.rb:47:in
start'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p484/gems/railties-3.2.6/lib/rails/commands/console.rb:8:in start' from /home/ubuntu/.rvm/gems/ruby-1.9.3-p484/gems/railties-3.2.6/lib/rails/commands.rb:41:in
<top (required)>'
from script/rails:6:in require' from script/rails:6:in
Thanks for reporting. I suspect this is fixed in 3.4.1 (but that release has some other bugs). I'm close to releasing 4.0, I will try reproduce this.