1

My rails 7 application is using turbo streams broadcast. But after running for a while it will start hanging/not loading anymore.

These are the last 3 lines from my application log

I, [2023-07-20T15:48:46.854914 #4211]  INFO -- : [047924b6-20d4-4aca-90bb-cca4efcf99e0] Started GET "/cable" [WebSocket] for 93.117.245.115 at 2023-07-20 15:48:46 +0200
I, [2023-07-20T15:48:46.854984 #4211]  INFO -- : [047924b6-20d4-4aca-90bb-cca4efcf99e0] Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: upgrade, HTTP_UPGRADE: websocket)
I, [2023-07-20T15:48:46.953230 #4211]  INFO -- : Turbo::StreamsChannel is streaming from assign_employees_7

The pages are no longer loading and it stays on this line. New requests are not being received anymore.

My code is as follows:

In the controller after update

Turbo::StreamsChannel.broadcast_update_to("assign_employees_#{company.id}", target: "assign_employees_#{company.id}", partial: 'activities/assign_employees', locals: { activities: activities, calendars: company.calendars, shifts: shifts, company: company, group_id: session[:group_id] })

In my view

<%= turbo_stream_from "assign_employees_#{current_company.id}" %>
<%= render 'assign_employees', activities: @activities, calendar: @calendars, shifts: @shifts, company: current_company, group_id: session[:group_id] %>

I am really clueless as to what is going on. Server performance seems fine. I also get this when running the application locally for a while.

cccvandermeer
  • 317
  • 2
  • 14
  • 1
    If you're running Puma 6 it could be this https://github.com/puma/puma/issues/2999 – snowangel Jul 22 '23 at 09:27
  • @snowangel i tried this, seemed to be better but after less then 24 hours the entire application hangs again on Turbo::StreamsChannel is streaming from and becomes unreachable – cccvandermeer Aug 04 '23 at 07:54

0 Answers0