ruby-hyperloop / hyperloop-config

The project has moved to Hyperstack!! - internal gem used by other hyperloop gems to define config settings
https://hyperstack.org/
MIT License
3 stars 4 forks source link

Lap20 crash with :pusher as transport #13

Closed barriehadfield closed 6 years ago

barriehadfield commented 6 years ago

We are only seeing this issue on Heroku (does not happen on a local instance). I have tested changing the transport to :simple_poller and all is fine, so it only happens with :pusher as the transport.


2018-02-08T12:13:40.378668+00:00 app[web.1]: D, [2018-02-08T12:13:40.378566 #14] DEBUG -- : [f25aa2d8-25bd-4690-9f52-e1d37349270d]   Hyperloop::Connection Load (1.2ms)  SELECT  "hyperloop_connections".* FROM "hyperloop_connections" WHERE "hyperloop_connections"."channel" = $1 AND "hyperloop_connections"."session" IS NULL LIMIT $2  [["channel", "Hyperloop::Session-794692d1a988e12b385d4e2a8b101e1b"], ["LIMIT", 1]]
2018-02-08T12:13:40.379669+00:00 app[web.1]: I, [2018-02-08T12:13:40.379579 #14]  INFO -- : [f25aa2d8-25bd-4690-9f52-e1d37349270d] Completed 401 Unauthorized in 354ms (ActiveRecord: 21.3ms)
2018-02-08T12:13:40.382196+00:00 app[web.1]: F, [2018-02-08T12:13:40.382097 #14] FATAL -- : [f25aa2d8-25bd-4690-9f52-e1d37349270d]   
2018-02-08T12:13:40.382298+00:00 app[web.1]: F, [2018-02-08T12:13:40.382207 #14] FATAL -- : [f25aa2d8-25bd-4690-9f52-e1d37349270d] **NoMethodError (undefined method `update' for nil:NilClass):**
2018-02-08T12:13:40.382368+00:00 app[web.1]: F, [2018-02-08T12:13:40.382288 #14] FATAL -- : [f25aa2d8-25bd-4690-9f52-e1d37349270d]   
2018-02-08T12:13:40.382547+00:00 app[web.1]: F, [2018-02-08T12:13:40.382430 #14] FATAL -- : [f25aa2d8-25bd-4690-9f52-e1d37349270d] **vendor/bundle/ruby/2.3.0/gems/hyper-operation-1.0.0.pre.lap20/lib/hyper-operation/transport/connection.rb:166:in `block in refresh_connections'**
2018-02-08T12:13:40.382549+00:00 app[web.1]: [f25aa2d8-25bd-4690-9f52-e1d37349270d] vendor/bundle/ruby/2.3.0/gems/hyper-operation-1.0.0.pre.lap20/lib/hyper-operation/transport/connection.rb:165:in `each'
2018-02-08T12:13:40.382551+00:00 app[web.1]: [f25aa2d8-25bd-4690-9f52-e1d37349270d] vendor/bundle/ruby/2.3.0/gems/hyper-operation-1.0.0.pre.lap20/lib/hyper-operation/transport/connection.rb:165:in `refresh_connections'
2018-02-08T12:13:40.382553+00:00 app[web.1]: [f25aa2d8-25bd-4690-9f52-e1d37349270d] vendor/bundle/ruby/2.3.0/gems/hyper-operation-1.0.0.pre.lap20/lib/hyper-operation/transport/connection.rb:111:in `active'
2018-02-08T12:13:40.382554+00:00 app[web.1]: [f25aa2d8-25bd-4690-9f52-e1d37349270d] vendor/bundle/ruby/2.3.0/gems/hyper-operation-1.0.0.pre.lap20/lib/hyper-operation/transport/policy.rb:385:in `regulate_broadcast'
2018-02-08T12:13:40.382556+00:00 app[web.1]: [f25aa2d8-25bd-4690-9f52-e1d37349270d] vendor/bundle/ruby/2.3.0/gems/hyper-mesh-1.0.0.pre.lap20/lib/reactive_record/broadcast.rb:5:in `after_commit'
2018-02-08T12:13:40.382557+00:00 app[web.1]: [f25aa2d8-25bd-4690-9f52-e1d37349270d] vendor/bundle/ruby/2.3.0/gems/hyper-mesh-1.0.0.pre.lap20/lib/active_record_base.rb:145:in `synchromesh_after_change'
2018-02-08T12:13:40.382558+00:00 app[web.1]: [f25aa2d8-25bd-4690-9f52-e1d37349270d] vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:413:in `block in make_lambda'
2018-02-08T12:13:40.382559+00:00 app[web.1]: [f25aa2d8-25bd-4690-9f52-e1d37349270d] vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:260:in `block in conditional'
2018-02-08T12:13:40.382560+00:00 app[web.1]: [f25aa2d8-25bd-4690-9f52-e1d37349270d] vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:511:in `block in invoke_after'
2018-02-08T12:13:40.382562+00:00 app[web.1]: [f25aa2d8-25bd-4690-9f52-e1d37349270d] vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:511:in `each'
2018-02-08T12:13:40.382563+00:00 app[web.1]: [f25aa2d8-25bd-4690-9f52-e1d37349270d] vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:511:in `invoke_after'
2018-02-08T12:13:40.382564+00:00 app[web.1]: [f25aa2d8-25bd-4690-9f52-e1d37349270d] vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:132:in `run_callbacks'
2018-02-08T12:13:40.382565+00:00 app[web.1]: [f25aa2d8-25bd-4690-9f52-e1d37349270d] vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:827:in `_run_commit_callbacks'
2018-02-08T12:13:40.382566+00:00 app[web.1]: [f25aa2d8-25bd-4690-9f52-e1d37349270d] vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:343:in `committed!'
2018-02-08T12:13:40.382567+00:00 app[web.1]: [f25aa2d8-25bd-4690-9f52-e1d37349270d] vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/transaction.rb:86:in `commit_records'```
barriehadfield commented 6 years ago

@janbiedermann thinks this is the client code sending a nil value. I will leave the issue open until we resolve it.

janbiedermann commented 6 years ago

I made hyper operation more robust here, as you suggested, as i believe it is a valid condition, that a channel may have no connections. I have seen this issue before, same place, with ActionCable. This issue may indicate a connection setup problem. This problem may now show up on the client in a different way, we will see. gem 'hyper-operation', git: 'https://github.com/ruby-hyperloop/hyper-operation.git', branch: '1_0_0'

janbiedermann commented 6 years ago

seems to do it