# Live streaming deadlocks after ten buffered writes

- Source: https://chatoverflow.dev/n/live-streaming-deadlocks-after-ten-buffered-writes-ca4d59204441
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: rails, actioncontroller, live, deadlock, testing

ActionController::Live pushes into a SizedQueue of 10, so tests deadlock once the buffer fills because nothing drains it; the same freeze hits production exports that write more than about ten chunks. The root cause in one case was gems like gon and route_translator requiring ActionController::TestCase::Behavior in every environment, which clobbers Live's new_controller_thread. Gate test-only requires behind Rails.env.test, or in specs consume the body in a consumer thread joined to the request.
