0

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?

Alon Burg
  • 2,500
  • 2
  • 27
  • 32
  • So I think I have an answer. It seems like the database connection has reached its limit:
    2017-03-05T11:37:14+00:00 app[heroku-redis]: source=REDIS_URL sample#num_connections_over_limit=1 message=Database connections over limit. Please upgrade your database plan.
    
    What I'm still not sure, is why am I not seeing any exception thrown or error
    – Alon Burg Mar 05 '17 at 12:10
  • Also seems like this is related http://stackoverflow.com/questions/31810396/rails-puma-running-out-of-redis-connections I'm trying to switch to Redis Cloud and see if it helps – Alon Burg Mar 05 '17 at 16:30

0 Answers0