Skip to content

fix(playback): stop a broken Dolby Vision RPU from hanging playback - #485

Merged
Quick104 merged 4 commits into
Silo-Server:mainfrom
RXWatcher:fix/dovi-rpu-probe
Jul 27, 2026
Merged

Quick104 merged 4 commits into
Silo-Server:mainfrom
RXWatcher:fix/dovi-rpu-probe

Conversation

@RXWatcher

@RXWatcher RXWatcher commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Problem

A Dolby Vision Profile 7 source whose RPU ffmpeg cannot parse takes the whole playback session down. The dovi_rpu bitstream filter does not fail cleanly — it rejects every packet while ffmpeg keeps running:

[dovi_rpu] Failed to read unit 1 (type 39).
[dovi_rpu] Failed to read access unit from packet.
[vost#0:0/copy] Error applying bitstream filters to a packet:
    Invalid data found ... Invalid SEI message: payload_size too large (64 bytes)

One observed session emitted 376,316 stderr lines before the process was killed. No manifest was ever built, master.m3u8 returned 503 after 9.7 seconds, and the client sat on a spinner. From the user's side the title simply never starts, with no error.

Approach

Whether the strip works is a property of the file, not of the ffmpeg build, so supportsDoviRPUFilter cannot answer it. Asking ffmpeg to strip two seconds to the null muxer can, in about a second.

The probe reads stderr, not the exit code. ffmpeg treats a per-packet bitstream-filter error as non-fatal and exits 0 — which is precisely how a stream that could never start reached a live session in the first place. There is a test pinning that behaviour.

The verdict is a planning input, not a transport patch. It sits in PlannerInputV3 alongside the transformation registries: the registries answer whether the executor carries the transformation, this answers whether the file does. A source that fails it is never planned onto a strip route at all.

That placement is what makes the fix hold. The plan is where DynamicRange = "hdr10", Claims.Video.HDR10 and the dolby_vision_metadata_removed / hdr10_base_layer_preserved validated claims are set, and it is what session.RemuxDVMode is derived from and persisted as. Suppressing the filter further downstream would leave all of those describing a stream the server is no longer producing, and would leave every path that re-derives the filter from the durable session free to put it straight back:

  • HandleStartTranscode — the client-driven restart behind quality changes, seeks and burn-in — which also re-derives the filter from file.PrimaryDVProfile() == 7 with no plan involved at all
  • the remote audio-switch restart, from updatedSession.RemuxDVMode
  • the progressive-remux transport, whose branch plan_v3 evaluates before the HLS branches

What the client gets

With no tone-map recipe in this tree, an HDR10-only client on an unstrippable P7 source has no route left. Rather than the generic hdr_transcode_unsupported (which sends the user looking for a missing encoder), the planner returns dv_conversion_unsupported — the terminal reason the server_dv7_to_hdr10 spec already declares — with a message naming the real cause. A client that advertises its own DV→HDR10 or DV→DV8.1 transformation still gets that route, carrying a dolby_vision_strip_unsupported_by_source degradation warning so the server-side drop is not silent.

The two paths that bypass the plan

Gated at the executor instead:

  • legacy/auto remux (web player, jellycompat, pre-v3 stream tokens) neutralizes the profile exactly as it already does for a missing dovi_rpu filter, so it still starts and still plays.
  • the explicit v3 strip recipe fails loudly. Reaching it with an unstrippable source means a session or stream token minted before the verdict was known; copying the base layer without the strip would emit dangling RPUs under an HDR10 claim, and attempting the strip is the hang. The request gets a definite 500 and the next start re-plans against the now-cached verdict.

The probe

  • Tri-state verdict. Only a stderr-confirmed rejection is cached. A timeout, a cancelled request, or an ffmpeg that will not start is inconclusive: the strip is kept and nothing is written. One client disconnecting mid-probe can no longer disable the strip for that file permanently.
  • Fails open. "We did not find out" means strip, consistently — the same rule the nil probe follows, because most Profile 7 sources genuinely need it.
  • Singleflight, so concurrent or retried starts of the same title share one ffmpeg.
  • 6s timeout, inside the budget a client waits on the manifest, and off the session lifecycle lock now that it runs at planning time. A source that cannot hand over two seconds of copied video in 6s cannot feed a live transcode either.
  • Keyed on size and mtime as well as path and binary, so a file replaced in place with the same length is re-probed rather than inheriting the old verdict.
  • stderr capture bounded at 64 KiB. The markers are in the first lines; a rejecting filter emits a pair per frame.
  • Bounded at 4096 entries, evicted oldest-first.
  • Head-only coverage is stated, not asserted. This catches a source that rejects from the first access unit — the observed failure. A source that parses cleanly at the head and breaks an hour in still fails mid-stream; that is the separate "bail out on repeated per-packet filter errors" problem below.

Testing

Unit tests for the stderr detection (using the real log lines above), the tri-state caching rules, cache-key invalidation, eviction, singleflight, follower cancellation, and the nil/unprobeable paths. Planner tests that an unstrippable source is never planned onto the strip, that the terminal names the Dolby Vision cause, that a client-side transformation still wins, and that a non-DV source never pays for a probe. Executor tests that legacy/auto drops the filter and the explicit recipe refuses.

go build ./..., go vet ./internal/... and -race clean. internal/playback and internal/api/handlers green apart from two failures that reproduce identically on the parent commit: TestServeDirectPlayChangedEntityRejectsOldIfRange and TestHandleReplanPlaybackV3SeekFailureRecoveryNeverChangesMediaVersion.

Caveat stated plainly: the logic and the fallback paths are verified; that the specific file which triggered this now plays is not. Its RPU is malformed enough that the base layer may have problems of its own. The guaranteed improvement is a fast, definite, honestly-labelled outcome instead of a ten-second hang and a spinner.

Follow-up not in scope

Even with this, a bitstream filter that fails at runtime for some other reason still spews unbounded stderr until the process is killed. Failing fast on repeated per-packet filter errors would be worth doing on its own.

AI-use disclosure

Written by Claude Opus 5 (Claude Code) working with @RXWatcher, who hit this on his own library and directed the investigation. Root cause came from the server logs of the failing session. The revision moving the decision into the planner was made by Claude Opus 5 in response to maintainer review.

Summary by CodeRabbit

  • Bug Fixes

    • Improved Dolby Vision Profile 7 playback by only applying DV RPU-to-HDR10 strip processing when the source supports it.
    • Prevented playback hangs and packet rejections caused by attempting strip conversions on incompatible sources.
    • Added clearer degradation/failure handling when server-based conversion isn’t usable, with safer fallbacks.
  • Tests

    • Added coverage for Dolby Vision strip eligibility probing, caching behavior, concurrency/coalescing, cancellation handling, and remux start/stop behavior for unstrippable sources.

RXWatcher and others added 2 commits July 26, 2026 16:09
A Profile 7 source whose RPU ffmpeg cannot parse took the whole session
down. The dovi_rpu bitstream filter does not fail cleanly — it rejects
every packet while ffmpeg runs on, so one observed session emitted
376,316 stderr lines before the process was killed, no manifest was ever
built, and the client got a 503 after ~10 seconds that it showed as an
endless spinner:

  [dovi_rpu] Failed to read unit 1 (type 39).
  [vost#0:0/copy] Error applying bitstream filters to a packet:
      Invalid data found ... Invalid SEI message: payload_size too large

Whether the strip works is a property of the file, not of ffmpeg, so
SupportsDoviRPUFilter cannot answer it — but asking ffmpeg to strip two
seconds to the null muxer can, in about a second. Profile 7 sources are
probed once each on the start path and the result is cached; a source
that fails is copied without the filter, which leaves the base layer and
plays. Refusing to play at all does not.

The probe reads stderr rather than trusting the exit code: ffmpeg treats
a per-packet bitstream-filter error as non-fatal and exits 0, which is
exactly how a stream that could never start reached a live session.

Cache is keyed on path plus size so a replaced file is re-probed, and
bounded like the letterbox cache. A nil probe keeps stripping, since most
Profile 7 sources need it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Db4dSxN9tH8yN7uUP549tK
@coderabbitai

coderabbitai Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 04400639-730b-492b-909e-5e558bd5467f

📥 Commits

Reviewing files that changed from the base of the PR and between 5538fb2 and 3d1935e.

📒 Files selected for processing (2)
  • internal/playback/dovi_rpu_probe.go
  • internal/playback/dovi_rpu_probe_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • internal/playback/dovi_rpu_probe.go
  • internal/playback/dovi_rpu_probe_test.go

📝 Walkthrough

Walkthrough

Playback now probes Dolby Vision Profile 7 sources before applying RPU stripping. Planning, remuxing, and playback restart paths avoid unsupported strip filters, while caching and concurrency behavior are covered by tests.

Changes

Dolby Vision strip capability

Layer / File(s) Summary
RPU probe and cache
internal/playback/dovi_rpu_probe.go, internal/playback/dovi_rpu_probe_test.go
Adds bounded ffmpeg probing, verdict caching, concurrent-call coalescing, cancellation handling, and rejection-detection tests.
Playback planning integration
internal/playback/plan_v3.go, internal/api/handlers/playback_v3.go, internal/playback/protocol_v3_test.go
Passes deferred source probes into planning, removes unsupported server strip routes, preserves client transforms, and reports terminal or degradation results.
Remux strip handling
internal/playback/remux.go, internal/playback/remux_dv_test.go
Disables legacy stripping for unstrippable sources and rejects explicit v3 strip recipes that cannot process the source.
Playback restart filter gating
internal/api/handlers/playback.go
Gates DV7-to-HDR10 filter assignment during audio-switch and client-driven transcode restarts.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PlaybackHandler
  participant PlanPlaybackV3
  participant DVRPUProbe
  participant FFmpeg
  PlaybackHandler->>PlanPlaybackV3: Build playback plan with deferred probe
  PlanPlaybackV3->>DVRPUProbe: Check source RPU stripability
  DVRPUProbe->>FFmpeg: Probe DV7-to-HDR10 filter
  FFmpeg-->>DVRPUProbe: Probe output and verdict
  DVRPUProbe-->>PlanPlaybackV3: Stripability result
  PlanPlaybackV3-->>PlaybackHandler: Plan, warning, or terminal result
Loading

Possibly related PRs

Suggested labels: v1

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 72.73% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: preventing malformed Dolby Vision RPU data from hanging playback.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The probe answered the right question in the wrong place. Suppressing the
bitstream filter as the transport was being built left the plan still
promising DynamicRange "hdr10", Claims.Video.HDR10 and the
dolby_vision_metadata_removed / hdr10_base_layer_preserved validated
claims, and left session.RemuxDVMode persisted as strip_to_hdr10 — so the
client was told it was getting clean HDR10 while receiving Profile 7 with
dangling RPUs, and every path that re-derives the filter from the durable
session put the hanging filter straight back:

  - HandleStartTranscode (quality change, seek, burn-in restart), which
    also re-derives it from file.PrimaryDVProfile() == 7 with no plan at all
  - the remote audio-switch restart, from updatedSession.RemuxDVMode
  - the progressive-remux transport, which plan_v3 evaluates *before* the
    HLS branches, so for many clients the broken file never reached the
    probe in the first place

The verdict is now a planner input alongside the transformation
registries: the registries answer whether the executor carries the
transformation, this answers whether the file does. A source that fails it
is never planned onto a strip route, so the plan's claims, RemuxDVMode and
every restart derived from them agree with what the pipeline can produce.
With no tone-map recipe in this tree an HDR10-only client has no route
left, so it gets a dv_conversion_unsupported terminal naming the real
cause rather than a generic HDR message; a client that can run its own DV
transformation still gets that route, with a degradation warning
explaining why the server route was dropped.

The two paths that bypass the plan entirely are gated at the executor:
legacy/auto remux neutralizes the profile exactly as it already does for a
missing dovi_rpu filter, and the explicit v3 strip recipe fails loudly
rather than emit dangling RPUs under an HDR10 claim.

The probe itself:

  - Tri-state verdict. Only a stderr-confirmed rejection is cached. A
    timeout, a cancelled request or an ffmpeg that will not start is
    inconclusive: the strip is kept and nothing is written, so one client
    disconnecting can no longer disable the strip for a file permanently.
  - Singleflight, so concurrent or retried starts of a title share one run.
  - Timeout cut to 6s, inside the budget a client waits on the manifest,
    and off the session lifecycle lock now that it runs at planning time.
  - Keyed on size and mtime as well as path and binary, so a file replaced
    in place with the same length is re-probed.
  - stderr capture bounded at 64 KiB; the markers are in the first lines
    and a rejecting filter emits a pair per frame.
  - The head-only coverage is stated rather than asserted: this catches a
    source that rejects from the first access unit, not one that breaks an
    hour in.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@Quick104

Copy link
Copy Markdown
Contributor

Pushed 5538fb2d to this branch addressing the review. Flagging up front that it changes the approach, not just the details — @RXWatcher you'll want to reset your local copy rather than rebase onto it.

The core change: the decision moved into the planner

The original patch answered the right question in the wrong place. Suppressing the bitstream filter while building the transport left everything upstream of it still believing the strip was happening:

  • the plan still carried DynamicRange = "hdr10", Claims.Video.HDR10 = true, and the dolby_vision_metadata_removed / hdr10_base_layer_preserved validated claims — so the client was told it was getting clean HDR10 and handed P7 with dangling RPUs, which is the input this repo's own comments say stalls hardware decoders;
  • session.RemuxDVMode was still persisted as strip_to_hdr10, and three separate paths re-derive the filter from it — HandleStartTranscode (quality change / seek / burn-in restart), the remote audio-switch restart, and the progressive-remux transport. Any of them puts the hanging filter back mid-session.

HandleStartTranscode was the worst of them: it derives the filter from file.PrimaryDVProfile() == 7 with no plan involved at all, so it would have reproduced the hang on the first seek. And the progressive-remux branch in plan_v3.go is evaluated before the HLS branches, so for a good number of clients the broken file never reached the probe in the first place — the fix was wired into 2 of at least 4 places that apply the filter.

The verdict is now a PlannerInputV3 field next to the transformation registries, which is the right analogy: the registries answer whether the executor carries the transformation, this answers whether the file does. Lazy and memoized like HLSRegistry, consulted only after every cheap gate has passed, so a non-DV start never shells out. A source that fails it is never planned onto a strip route, and the claims, RemuxDVMode and all three restart paths are consistent by construction.

One consequence worth calling out

I'd assumed the fallback would be a transcode. It isn't — hdrTranscodeUnavailableV3 rejects any non-SDR source and there's no tone-map recipe in the tree, so an HDR10-only client on an unstrippable P7 source has no route at all. That makes it a terminal.

I think that's the honest answer, and better than either alternative: the original behaviour was a 10s spinner, and copying without the strip is not reliably playable for dual-layer P7 (dangling RPUs on the base layer) while also being a silent lie about the format. So the planner returns dv_conversion_unsupported — the terminal reason the server_dv7_to_hdr10 spec already declares, so no new client contract — with a message naming the actual cause instead of the generic hdr_transcode_unsupported, which would send someone looking for a missing encoder. Clients that advertise their own DV→HDR10 or DV→DV8.1 transformation are unaffected and still get that route, with a dolby_vision_strip_unsupported_by_source degradation warning explaining the server-side drop.

Happy to revisit if you'd rather it degrade to something playable, but I don't think there's a playable option for that combination today.

Probe fixes

  • Cache poisoning. CanStrip cached unconditionally, so a probe killed by a client disconnect, a missing ffmpeg, a transient I/O error or a timeout would permanently disable the strip for that file for everyone — directly contradicting the deliberate nil-probe "keep stripping" fallback 25 lines above. Now tri-state: only a stderr-confirmed rejection is cached; inconclusive keeps the strip and writes nothing.
  • Timeout. 15s → 6s, i.e. inside the ~10s client budget rather than beyond it. Also no longer inside LockSessionLifecycle, since it runs at planning time.
  • Singleflight added; concurrent and retried starts of a title share one run.
  • Cache key now includes mtime and the ffmpeg binary, not just path and size — same-length in-place replacement was inheriting the old verdict.
  • Bounded stderr capture (64 KiB). You were right that -t 2 bounds the read in the healthy case, but a source killed at the timeout mid-flood isn't bounded by it, and it costs nothing to cap.
  • Comment corrections. "a file that survives this survives the run" is now stated as what it actually is — this catches a source that rejects from the first access unit, not one that breaks an hour in. Also dropped the reference to "the letterbox cache", which doesn't exist in this repo; the real precedent is supportsDoviRPUFilter in internal/playback/remux.go, now named correctly.

Executor-level gating

The two paths that bypass the plan entirely are handled where they are, rather than left to a plan they never consult: legacy/auto remux neutralizes the profile exactly as it already does for a missing dovi_rpu filter, and the explicit v3 strip recipe returns an error (surfacing as a 500 from ServeRemuxWithDVMode, not the empty 200 the old path would have produced) so the next start re-plans against the cached verdict.

Verification

go vet ./internal/... and -race clean. Two test failures remain in internal/playback and internal/api/handlers; both reproduce identically on 73d4de7f — TestServeDirectPlayChangedEntityRejectsOldIfRange (fails 3/3 there) and TestHandleReplanPlaybackV3SeekFailureRecoveryNeverChangesMediaVersion. The NVENC tests pass here; that box is Linux with an NVIDIA card, which is why they behaved differently on your Mac.

New tests cover the planner gating and terminal, the client-transformation route surviving, a non-DV source never paying for a probe, both executor paths, and the probe's tri-state caching, singleflight, follower cancellation and output bounding.


🤖 Generated with Claude Code

@coderabbitai coderabbitai Bot added the v1.0 Silo v1 scope - auto-adds to the Silo v1 project label Jul 27, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
internal/playback/dovi_rpu_probe_test.go (1)

47-68: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Test doesn't actually exercise the "same size, different mtime" case it documents.

"original" (8 bytes) vs "replaced, same length" (21 bytes) differ in size, so size alone would already change the key — the mtime-matters claim in the comment isn't exercised.

♻️ Use equal-length replacement content
-	if err := os.WriteFile(path, []byte("replaced, same length"), 0o600); err != nil {
+	if err := os.WriteFile(path, []byte("changed!!"), 0o600); err != nil {
 		t.Fatalf("replace probe fixture: %v", err)
 	}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/playback/dovi_rpu_probe_test.go` around lines 47 - 68, Update
TestProbeKeyChangesWithTheFile to replace the probe fixture with content exactly
matching the original file’s length while still differing in contents, so the
assertion exercises key invalidation from a changed modification time rather
than a size change.
internal/playback/remux.go (1)

230-231: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Silent DV7-strip fallback: add the warning log already used elsewhere. Both sites gate the Dolby Vision strip on the new per-source RPU probe and silently fall back when it fails, while the equivalent gate in internal/api/handlers/playback.go#L3107-L3122 logs a warning ("restart dropped the dolby vision rpu strip: source cannot be stripped") on the same failure. Without a log, operators lose the one signal that would explain why a given file lost DV handling.

  • internal/playback/remux.go#L230-L231: log (e.g. via slog.Warn) when sharedDVRPUProbe.CanStrip returns false for a profile-7 source, mirroring supportsDoviRPUFilter's existing warning for the missing-filter case.
  • internal/api/handlers/playback.go#L2612-L2618: add an else branch that logs a warning (matching the message/fields used at playback.go#L3119-L3120) when playback.DVRPUStrippable(...) returns false, instead of silently omitting nodeReq.VideoBitstreamFilter.
♻️ Proposed fix for remux.go
 	case "", RemuxDVLegacyAutoV3:
-		effectiveProfile = remuxDVProfile(dvProfile, supportsDoviRPUFilter(bin) &&
-			(dvProfile != 7 || sharedDVRPUProbe.CanStrip(ctx, bin, filePath)))
+		filterAvailable := supportsDoviRPUFilter(bin)
+		canStrip := filterAvailable
+		if dvProfile == 7 && filterAvailable {
+			canStrip = sharedDVRPUProbe.CanStrip(ctx, bin, filePath)
+			if !canStrip {
+				slog.Warn("source's Dolby Vision RPU cannot be parsed; dropping the strip for this remux", "ffmpeg", bin, "file", filePath)
+			}
+		}
+		effectiveProfile = remuxDVProfile(dvProfile, canStrip)
♻️ Proposed fix for playback.go
-				if updatedSession.RemuxDVMode == playback.RemuxDVStripToHDR10V3 && strings.EqualFold(nodeReq.TargetCodecVideo, "copy") &&
-					playback.DVRPUStrippable(r.Context(), h.playbackConfig().FFmpegPath, file.FilePath) {
-					nodeReq.VideoBitstreamFilter = playback.DV7ToHDR10BitstreamFilter
-				}
+				if updatedSession.RemuxDVMode == playback.RemuxDVStripToHDR10V3 && strings.EqualFold(nodeReq.TargetCodecVideo, "copy") {
+					if playback.DVRPUStrippable(r.Context(), h.playbackConfig().FFmpegPath, file.FilePath) {
+						nodeReq.VideoBitstreamFilter = playback.DV7ToHDR10BitstreamFilter
+					} else {
+						slog.WarnContext(r.Context(), "audio-switch restart dropped the dolby vision rpu strip: source cannot be stripped",
+							"component", "api", "playback_session_id", sessionID, "file_id", file.ID)
+					}
+				}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/playback/remux.go` around lines 230 - 231, Log a warning when DV RPU
stripping is skipped by the per-source probe: in internal/playback/remux.go at
lines 230-231, detect a profile-7 source where sharedDVRPUProbe.CanStrip returns
false and mirror the existing supportsDoviRPUFilter warning; in
internal/api/handlers/playback.go at lines 2612-2618, add an else branch for
playback.DVRPUStrippable returning false and use the warning message and fields
already used around lines 3119-3120.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/playback/dovi_rpu_probe.go`:
- Around line 108-166: Update CanStrip so the shared runDVRPUProbe call uses a
context detached from caller cancellation via context.WithoutCancel(ctx), while
preserving the existing dvRPUProbeTimeout and timeout handling inside the probe.
Keep follower waiting and caching behavior unchanged, so cancellation of the
leader does not force an unknown fail-open result for the in-flight probe.

---

Nitpick comments:
In `@internal/playback/dovi_rpu_probe_test.go`:
- Around line 47-68: Update TestProbeKeyChangesWithTheFile to replace the probe
fixture with content exactly matching the original file’s length while still
differing in contents, so the assertion exercises key invalidation from a
changed modification time rather than a size change.

In `@internal/playback/remux.go`:
- Around line 230-231: Log a warning when DV RPU stripping is skipped by the
per-source probe: in internal/playback/remux.go at lines 230-231, detect a
profile-7 source where sharedDVRPUProbe.CanStrip returns false and mirror the
existing supportsDoviRPUFilter warning; in internal/api/handlers/playback.go at
lines 2612-2618, add an else branch for playback.DVRPUStrippable returning false
and use the warning message and fields already used around lines 3119-3120.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 46bdb1f4-9b2f-4315-a9e9-b910fa2ae4ac

📥 Commits

Reviewing files that changed from the base of the PR and between 02203d9 and 5538fb2.

📒 Files selected for processing (8)
  • internal/api/handlers/playback.go
  • internal/api/handlers/playback_v3.go
  • internal/playback/dovi_rpu_probe.go
  • internal/playback/dovi_rpu_probe_test.go
  • internal/playback/plan_v3.go
  • internal/playback/protocol_v3_test.go
  • internal/playback/remux.go
  • internal/playback/remux_dv_test.go

Comment thread internal/playback/dovi_rpu_probe.go Resolved
The probe rode the caller's context, so a leader whose client disconnected
returned dvRPUUnknown — and CanStrip then handed that fail-open to every
follower already blocked on the shared call, even though their own requests
were still alive. One client walking away was enough to give a live session
the strip the source cannot survive, which is the hang this whole change
exists to prevent. The work was also thrown away, so the next start paid for
the probe again.

Run it under context.WithoutCancel instead. dvRPUProbeTimeout still bounds
it, so nothing is left running; a verdict reached after the leader has gone
is still correct and still worth caching. Follower behaviour is unchanged:
a follower whose own request is cancelled still leaves immediately rather
than waiting on someone else's probe.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@Quick104

Copy link
Copy Markdown
Contributor

Pushed 3d1935ee: the probe now runs under context.WithoutCancel.

The leader was probing on the caller's context, so if its client disconnected the run returned dvRPUUnknown — and CanStrip handed that fail-open straight to every follower already blocked on the shared call, even though their own requests were fine. One client walking away was enough to give a live session the strip the source cannot survive, i.e. the exact hang this PR exists to prevent, now reachable through an unrelated client. The work was discarded too, so the next start re-paid for the probe.

dvRPUProbeTimeout still bounds the run, so nothing is left dangling, and a verdict reached after the leader has gone is still correct and still worth caching. Follower behaviour is unchanged — a follower whose own request is cancelled still leaves immediately instead of waiting on someone else's probe.

TestProbeSurvivesTheLeaderLeaving covers it, and fails on the previous commit.


🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v1.0 Silo v1 scope - auto-adds to the Silo v1 project

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants