I'm facing a weird issue. I have created an ActionCable controller to allow simplistic chat rooms.
When everything works, log messages show the transmitting
message upon calling broadcast_to.
2017-03-05T10:29:21.624294+00:00 app[web.1]: I, [2017-03-05T10:29:21.624222 #4] INFO -- : [ActionCable] [abfcd3d23b1f4b895ce06cad5df51b8c] Registered connection (abfcd3d23b1f4b895ce06cad5df51b8c) 2017-03-05T10:29:21.811899+00:00 app[web.1]: I, [2017-03-05T10:29:21.811815 #4] INFO -- : [ActionCable] [abfcd3d23b1f4b895ce06cad5df51b8c] ChatChannel is transmitting the subscription confirmation 2017-03-05T10:29:21.812216+00:00 app[web.1]: I, [2017-03-05T10:29:21.812170 #4] INFO -- : [ActionCable] [abfcd3d23b1f4b895ce06cad5df51b8c] ChatChannel is streaming from chat:room_6512bd43d9caa6e02c990b0a82652dca 2017-03-05T10:29:22.204456+00:00 app[web.1]: I, [2017-03-05T10:29:22.204364 #4] INFO -- : [ActionCable] [abfcd3d23b1f4b895ce06cad5df51b8c] ChatChannel#some_event 2017-03-05T10:29:22.204555+00:00 app[web.1]: I, [2017-03-05T10:29:22.204497 #4] INFO -- : [ActionCable] [abfcd3d23b1f4b895ce06cad5df51b8c] [ActionCable] Broadcasting to chat:room_6512bd43d9caa6e02c990b0a82652dca: {:type=>"some_event", :user=>"abfcd3d23b1f4b895ce06cad5df51b8c"} 2017-03-05T10:29:22.207224+00:00 app[web.1]: I, [2017-03-05T10:29:22.207164 #4] INFO -- : [ActionCable] [abfcd3d23b1f4b895ce06cad5df51b8c] ChatChannel transmitting {"type"=>"some_event", "user"=>"abfcd3d23b1f4b895ce06cad5df51b8c"} (via streamed from chat:room_6512bd43d9caa6e02c990b0a82652dca)
However when things stop working, the transmitting
log message just stops showing
2017-03-05T09:29:20.534234+00:00 app[web.1]: I, [2017-03-05T09:29:20.534167 #4] INFO -- : [ActionCable] [b41c709c21deb8a2e9ae5f27b38d04b3] Registered connection (b41c709c21deb8a2e9ae5f27b38d04b3) 2017-03-05T09:29:20.747209+00:00 app[web.1]: I, [2017-03-05T09:29:20.747112 #4] INFO -- : [ActionCable] [b41c709c21deb8a2e9ae5f27b38d04b3] ChatChannel is transmitting the subscription confirmation 2017-03-05T09:29:20.747612+00:00 app[web.1]: I, [2017-03-05T09:29:20.747562 #4] INFO -- : [ActionCable] [b41c709c21deb8a2e9ae5f27b38d04b3] ChatChannel is streaming from chat:room_6512bd43d9caa6e02c990b0a82652dca 2017-03-05T09:29:20.934563+00:00 app[web.1]: I, [2017-03-05T09:29:20.934473 #4] INFO -- : [ActionCable] [b41c709c21deb8a2e9ae5f27b38d04b3] ChatChannel#some_event 2017-03-05T09:29:20.934684+00:00 app[web.1]: I, [2017-03-05T09:29:20.934626 #4] INFO -- : [ActionCable] [b41c709c21deb8a2e9ae5f27b38d04b3] [ActionCable] Broadcasting to chat:room_6512bd43d9caa6e02c990b0a82652dca: {:type=>"some_event", :user=>"b41c709c21deb8a2e9ae5f27b38d04b3"}
This is deployed on Heroku with Redis. When things stop working, doing heroku restart
will fix everything and make things work again.
small update
When trying to do Redis.new.pubsub("numsub", "chat:room_6512bd43d9caa6e02c990b0a82652dca")
when everything is working I get:
=> ["chat:room_6512bd43d9caa6e02c990b0a82652dca", 1]
when things stop working
=> ["chat:room_6512bd43d9caa6e02c990b0a82652dca", 0]
Any ideas?