Repository navigation
DeviceEngine: drain autorelease pools and use kern.bootsessionuuid - #42
Merged
henrikklee merged 1 commit intoDec 4, 2026
Merged
Conversation
Wrap long-lived thread loops in DeviceEngine (refresh, perform, shrinkAPFSInSteps), ResizeHelper (refresh and RPC loop), and AppOpener in autoreleasepool so bridged Foundation objects are freed each step instead of accumulating over multi-hour shrinks. Switch DeviceEngine.bootIdentity() from kern.boottime (which shifts when NTP adjusts the wall clock) to kern.bootsessionuuid, with kern.boottime kept only as a fallback. This prevents a helper respawn in the same boot from being misclassified as a device restart and unnecessarily cutting the next shrink budget to a quarter. Fixes OrchardLinux#41 Assisted-by: LLM
grierj
force-pushed
the
fix/autoreleasepool-and-boot-uuid
branch
from
December 4, 2026 16:52
240ddcb to
2538a35
Compare
Merged
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.
Fixes #41.
Changes
DeviceEngine(refresh(),perform(),shrinkAPFSInSteps()),ResizeHelper/main.swift(refresh and RPC loops), andAppOpener.swiftinautoreleasepool { ... }so bridged Foundation/Obj-C objects are released on every iteration instead of accumulating over multi-hour APFS shrinks.kern.bootsessionuuid(withkern.boottimefallback) inDeviceEngine.bootIdentity()so NTP clock adjustments during a long shrink do not cause a same-boot helper respawn to be misclassified as a device reboot (which also needlessly wroterestart-budget.json).testBootIdentityUsesStableBootSessionUUIDinTests/ResizeCoreTests/OperationHistoryTests.swift.Verification
python3 scripts/check-release.py: PASS (165 files)python3 -m unittest discover -s Tests/ReleaseTests: 156 tests OKswift testruns in GitHub Actions CI (macos-15-intel).