Repository navigation
fix(demux): align origin-slot completion with playback priority - #746
Merged
superuser404notfound merged 1 commit intoOct 13, 2026
Conversation
yucelokan
force-pushed
the
fix/playback-origin-callback-priority
branch
from
October 11, 2026 23:24
5f29bb2 to
72e2fc8
Compare
yucelokan
force-pushed
the
fix/playback-origin-callback-priority
branch
from
October 12, 2026 12:20
72e2fc8 to
e3f98ab
Compare
superuser404notfound
merged commit Oct 13, 2026
ea3e4fc
into
superuser404notfound:main
4 checks passed
superuser404notfound
pushed a commit
that referenced
this pull request
Oct 13, 2026
) #746 moved the 429 accounting into syncRequest's completion callback so the slot is not handed on before the refusal is on the books, but the detour still charged the same answer again afterwards. Each charge halves the origin's concurrency and doubles its quiet period, so one 429 on a detour block quartered the budget. The detour now only reads the Retry-After it hands its caller. The new callbacks also passed an absent Retry-After as 0, which the budget reads as a zero quiet period instead of the exponential ladder; the old detour path mapped it to nil. One helper charges the response for all three finite request paths and keeps that mapping. The CHANGELOG entry moves under Unreleased: the branch predated the 7.35.0 cut. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS
Owner
|
Merged in ea3e4fc, thank you. Returning the slot from the completion callback is the right shape, and charging the refusal before that return is what keeps the next waiter from walking straight into the same 429. Two follow-ups landed in b141b14:
On the delegate queues: an earlier measurement here (AE#272) found no difference between the implicit queue and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Run byte delivery and origin-slot completion at the same priority as foreground demux work. This addresses a user-initiated reader waiting for a request slot released by a lower-priority URLSession callback.
What changed
Test plan
swift test --jobs 4 --disable-automatic-resolutionpassed (764 XCTest cases, one skipped; 4,302 Swift Testing cases reported, with fixture-dependent skips). After the CI test correction, the full Swift Testing suite also passed withLIBDISPATCH_COOPERATIVE_POOL_STRICT=1, including both normal and deliberately delayed cache-hit cases.swift build, doc links andgit diff --checkpassed.cacheHitDoesNotSignalassertion failed under parallel load. Its slow-serve timer is armed before the cache lookup, so the assertion incorrectly required the serving thread to finish inside 20 ms. The correction changes only that regression and its documentation; no HLS runtime behavior or timeout is changed.Current-main integration, 12 October 2026
Rebased this standalone PR onto upstream main
004eea20(FFmpegBuild 3.7.1). Its complete macOS package/CLI/example build, documentation links and whitespace checks passed locally; the full-suite figures above describe the previous PR revision. Current-head CI supplies the full tests and platform matrix.Additional integrated-fork device sessions used Apple TV / tvOS 27.0 and iPad / iOS 26.6.1 concurrently: private MPEG-TS channels, H.264 High Level 4.0 / 1920×1080 / 25 fps / SDR + AAC-LC stereo 48 kHz. Four repeated-source intervals were removed without sampled backward clocks, restarts or software fallback. Video-only gaps exposed an outgoing-PES interleaving edge case; that correction and its diagnostics are kept in #747. These are integrated device results, not isolated trigger coverage for every PR.
Current-head CI:
e3f98abepassed all four checks: macOS full/strict-pool tests, iOS Simulator plus release CLI, tvOS/visionOS Simulator, and documentation links.Checklist
CHANGELOG.mdupdatedfix(...))Four-device integration follow-up (12 October 2026)
The integrated downstream build containing this PR was exercised on an iPhone/iOS 26.6.1, iPad/iPadOS 26.6.1, Apple TV/tvOS 27.0 and a Mac running the iPad-compatible app/macOS 27.0.1. The sanitized device, media and scenario report covers 8,246 current-build diagnostic records, 27 verified replay removals, live seeking and VOD/PiP use.
The remaining decoded-video boundary defects and recovery correction are in #747; this PR's code and standalone validation remain unchanged. These integration logs are not an isolated physical-device proof of this PR's specific failure path. No private source URLs, credentials or media are included.