Fix DNS preference continuation leak#3
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ea1e83aa7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| func scheduleTimeout() { | ||
| DispatchQueue.main.asyncAfter(deadline: .now() + 10) { [weak self] in |
There was a problem hiding this comment.
Retain the timeout operation until it fires
When loadFromPreferences/saveToPreferences never invoke or retain the completion handler, the only reference left to PreferenceOperationContinuation is this weak capture, so it can be deallocated before the 10-second deadline and the timeout block returns without resuming the checked continuation. That leaves Apply/Revert suspended and preserves the continuation leak in exactly the entitlement/provisioning failure path this change is trying to handle; the timeout closure needs to keep the operation alive until it either fires or an earlier callback clears the continuation.
Useful? React with 👍 / 👎.
Summary
SWIFT TASK CONTINUATION MISUSE: loadFromPreferences() leaked its continuationlog by avoiding the ambiguous async preference wrapperNotes
The other logs in the report (
AppleLanguages,linkd.autoShortcut, tab indexing, task name port) appear to be framework or runtime noise from macOS/SwiftPM app launching rather than Locale-owned code paths. This PR fixes the app-owned continuation leak that can hang DNS proxy preference updates.Validation
swift test./script/build_and_run.sh --build-onlyon the original branch before cherry-picking this focused fix