signalwire / signalwire-ruby

MIT License
9 stars 11 forks source link

SignalWire Consumer does not reconnect #57

Closed PQALAB closed 5 years ago

PQALAB commented 5 years ago

I have a consumer that periodically loses connection to signalwire, but never reconnects. Currently we have to restart the consumer to get it to reconnect.

I, [2019-09-18T16:25:07.001309 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:25:12.009451 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:25:17.027906 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:25:22.047852 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:25:27.056115 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:25:32.073758 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:25:37.092305 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:25:42.108224 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:25:47.115779 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:25:52.124746 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:25:57.134728 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:26:02.142458 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:26:07.160437 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:26:12.185793 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:26:17.193899 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:26:22.213661 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:26:27.221808 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:26:32.229571 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:26:37.248667 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:26:42.277817 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:26:47.296616 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:26:52.328378 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:26:57.336530 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:27:02.354255 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:27:07.371978 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:27:12.380067 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:27:17.398037 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:27:22.429908 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:27:27.446055 #6816] INFO -- SignalWire: Attempting reconnection I, [2019-09-18T16:27:32.453617 #6816] INFO -- SignalWire: Attempting reconnection Traceback (most recent call last): 22: from consumer.rb:19:in

' 21: from /usr/local/rvm/gems/ruby-2.5.1/gems/signalwire-2.1.2/lib/signalwire/relay/consumer.rb:57:in run' 20: from /usr/local/rvm/gems/ruby-2.5.1/gems/signalwire-2.1.2/lib/signalwire/relay/client.rb:35:inconnect!' 19: from /usr/local/rvm/gems/ruby-2.5.1/gems/signalwire-2.1.2/lib/signalwire/blade/connection.rb:36:in connect!' 18: from /usr/local/rvm/gems/ruby-2.5.1/gems/signalwire-2.1.2/lib/signalwire/blade/connection.rb:48:inmain_loop!' 17: from /usr/local/rvm/gems/ruby-2.5.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:203:in run' 16: from /usr/local/rvm/gems/ruby-2.5.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:203:inrelease_machine' 15: from /usr/local/rvm/gems/ruby-2.5.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:1482:in event_callback' 14: from /usr/local/rvm/gems/ruby-2.5.1/gems/faye-websocket-0.10.9/lib/faye/websocket/client.rb:87:inunbind' 13: from /usr/local/rvm/gems/ruby-2.5.1/gems/faye-websocket-0.10.9/lib/faye/websocket/api.rb:152:in finalize_close' 12: from /usr/local/rvm/gems/ruby-2.5.1/gems/faye-websocket-0.10.9/lib/faye/websocket/api/event_target.rb:44:indispatch_event' 11: from /usr/local/rvm/gems/ruby-2.5.1/gems/websocket-driver-0.7.1/lib/websocket/driver/event_emitter.rb:38:in emit' 10: from /usr/local/rvm/gems/ruby-2.5.1/gems/websocket-driver-0.7.1/lib/websocket/driver/event_emitter.rb:38:ineach' 9: from /usr/local/rvm/gems/ruby-2.5.1/gems/websocket-driver-0.7.1/lib/websocket/driver/event_emitter.rb:39:in block in emit' 8: from /usr/local/rvm/gems/ruby-2.5.1/gems/signalwire-2.1.2/lib/signalwire/blade/connection.rb:53:inblock (2 levels) in main_loop!' 7: from /usr/local/rvm/gems/ruby-2.5.1/gems/signalwire-2.1.2/lib/signalwire/blade/connection.rb:123:in handle_close' 6: from /usr/local/rvm/gems/ruby-2.5.1/gems/signalwire-2.1.2/lib/signalwire/blade/connection.rb:44:inreconnect!' 5: from /usr/local/rvm/gems/ruby-2.5.1/gems/signalwire-2.1.2/lib/signalwire/blade/connection.rb:48:in main_loop!' 4: from /usr/local/rvm/gems/ruby-2.5.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:171:inrun' 3: from /usr/local/rvm/gems/ruby-2.5.1/gems/signalwire-2.1.2/lib/signalwire/blade/connection.rb:59:in block in main_loop!' 2: from /usr/local/rvm/gems/ruby-2.5.1/gems/signalwire-2.1.2/lib/signalwire/blade/connection.rb:64:inschedule_flush_queues' 1: from /usr/local/rvm/gems/ruby-2.5.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:328:in add_timer' /usr/local/rvm/gems/ruby-2.5.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:328:inadd_oneshot_timer': ran out of timers; use #set_max_timers to increase limit (RuntimeError)`

bryanrite commented 5 years ago

@PQALAB Looks like you're using version 2.1.2, could you try using version 2.1.3 or higher? 2.1.3 added a fix for reconnection issues, and will likely solve this issue.

PQALAB commented 5 years ago

I'll give that a shot, thanks for the quick replay @bryanrite. I will post the back by EOD on if it fixes the issue

PQALAB commented 5 years ago

@bryanrite it's been running strong and reconnected successfully, thank you.

E, [2019-09-26T17:34:56.462921 #15330] ERROR -- SignalWire: We got disconnected! I, [2019-09-26T17:35:01.482190 #15330] INFO -- SignalWire: Attempting reconnection I, [2019-09-26T17:35:01.947191 #15330] INFO -- SignalWire: Blade Session connected with id ***