Repository navigation
Description
What happened?
The sweep that removes abandoned session directories only runs when a SegmentCache or a disk packet spool is created. A load that creates neither never runs it:
- the software path with the memory packet store (the tvOS default),
- audio-only sources.
So when the app is killed during a native session, that session's aether-segments/<uuid>/ directory stays in the temporary directory until some later load takes the native route. On an Apple TV 4K (4th generation) running a NuvioTVOS build, a session killed during a 4K title left 886 MB in tmp/aether-segments/. It survived several later playbacks on a route that creates no segment cache, hours after it was past the one-hour age.
Steps to reproduce
On macOS with aetherctl from main (cf3c6ea):
- Plant an abandoned session directory older than an hour:
T=$(getconf DARWIN_USER_TEMP_DIR)aether-segments D=$T/0E0D0C0B-1111-2222-3333-444455556666 mkdir -p $D && dd if=/dev/zero of=$D/seg-1-1.m4s bs=1m count=50 && touch $D/session.lock SetFile -d "11/28/2026 04:22:00" $D swift run aetherctl play --seconds 8 vp9.webm(route = software). The directory is still there.swift run aetherctl play --seconds 6 tone.m4a(route = audio). Still there.swift run aetherctl play --seconds 8 h264.mp4(route = loopback). Now it is gone.
(TMPDIR= does not move the engine's directory; NSTemporaryDirectory() answers the per-user folder.)
AetherEngine version or commit SHA
7.77.0 / main cf3c6ea (also seen in the copy NuvioTVOS vendors, 7.76.0 plus patches)
Host app
Custom / my own integration
Platform
tvOS
OS version
tvOS 27.2.1; macOS 27.2.1 for the repro
Device / chip
Apple TV 4K (4th generation), AppleTV18,1; Mac for aetherctl
Playback path
Not sure / not a playback bug
Source media (for playback bugs)
Not media specific. Killed session: a 4K HEVC title on the native route. Later playbacks that did not clean up: a 1080p TV episode the engine played without a segment cache, plus synthetic VP9 WebM and AAC M4A clips in the repro.
Error codes / log lines
None. Nothing is logged, because the sweep never runs.
Anything else
Related: AE#451 made the sweep spare live sessions. This is the other side: when the sweep runs at all.
Suggested fix: schedule the same bounded sweep (both the segment cache and the packet spool kinds) at every load(), off the load's path. It keeps the existing rules: one hour of age and an unheld marker. I have a PR ready.
Activity
fix(session): keep the sweep at load out of the standalone spool chec…
test(session): pin that every load schedules the stale sweep (superus…
fix(session): sweep abandoned session directories at every load (#1148)…
superuser404notfound commentedon Nov 30, 2026
The fix from #1149 is on main as c20705a, plus a ten-minute throttle and a sweep at engine creation. It will be in the next release. If you get a chance, could you check on the Apple TV that a killed session's directory still goes at the next play? I'll leave this open until then.