Skip to content

v1.10.1: Ruby 4.0.9, Rails 8.1.4.1, streams that stay up

Latest

Choose a tag to compare

@vitobotta vitobotta released this 06 Nov 00:20
· 6 commits to main since this release
95be471

What's fixed

Streams no longer die while the player parks its reader

A transcode response could be torn down mid-film, then come back as a black frame with a still frame or a "Buffering..." pause that cleared seconds later. The cause was inside the app server, not the proxy or the encoder: the client stopped reading the response for about 15 seconds while it held up to 45 seconds of forward buffer, and Puma 8 waits at most 10 seconds for a writable socket before it raises ClientDisconnected.

  • The forward band is now 45/42 seconds, so parking a full buffer drains in about 3 seconds instead of 15.
  • A new reader liveness check stops a paused or frozen media element from holding the response unread past the server's write timeout.
  • A rebuilt session no longer enters the rebuffer gate before playback starts, which is what put a paused session on a black frame and labelled it "Buffering...".
  • Rebuilt sessions resume on the 4 second seek cushion instead of waiting for the 30 second startup target.

Production evidence behind the fix: 16 of the 19 disconnects on sessions longer than 20 seconds carried an idle time between 9.4 and 11.2 seconds, and the reader was parked for 81 to 99% of every session.

Security

Rails 8.1.4.1 is a security release. The advisory that matters here is the ActionController::Live fix: a live stream no longer blocks when a full buffer is closed or aborted, which is the same code that serves transcodes and direct streams. Also relevant: ActionDispatch::RemoteIp now raises when Forwarded and X-Forwarded-For carry conflicting addresses, and rendered responses gained a Vary header on Accept and X-Requested-With when the format is not in the URL.

The remaining advisories in that release do not apply to this app: no Active Support MessagePack serialization, no constantize, no Action Cable, no strip_tags or highlight, no CacheStore sessions, no Active Storage attachments and no Action Mailbox. The sanitizer chain they describe is still upgraded (rails-html-sanitizer 1.7.2 with Loofah 2.25.3 and Nokogiri 1.19.7).

Ruby 4.0.9 fixes regular expression compilation bugs found by GitLab. The app compiles no user-supplied patterns.

Housekeeping

  • Ruby 4.0.5 to 4.0.9, Rails 8.1.4 to 8.1.4.1, and every gem in the lockfile that could move: rack, nokogiri, rails-html-sanitizer, loofah, solid_queue, sqlite3, tailwindcss-rails, cuprite, ferrum, faraday, bootsnap and the rest. 17 gems changed, no downgrades.
  • diff-lcs, marcel, net-ssh and prism stay where they are because rspec, Active Storage, Kamal and rubocop-ast cap them.
  • The subtitle timeout spec no longer races a freshly spawned Ruby interpreter: its deadline was 0.5 seconds, which the child sometimes could not meet under load, so the suite failed about one run in six on expected "" to include "Hello". The example now gives the child 2 seconds and still exercises a timeout that fires after cues were written.

Full Changelog: v1.10.0...v1.10.1