Skip to content

fix(minimal): flush the macOS system resolver cache in the finalize-install scripts - #2306

Merged
norrietaylor merged 3 commits into
mainfrom
inbox-patch/macos-resolver-flush-6c42c90469a5af5f
Oct 18, 2026
Merged

norrietaylor merged 3 commits into
mainfrom
inbox-patch/macos-resolver-flush-6c42c90469a5af5f

Conversation

@gominimal-aw-bot

@gominimal-aw-bot gominimal-aw-bot Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Routing-Key: inbox-route/I_kwDOSUhdos8AAAABX3vSQg

What

min finalize-install writes /etc/resolver/min.internal on macOS, but the install and undo scripts it emits never ask configd or mDNSResponder to re-read the resolver configuration or drop cached answers: pickup depends on the system noticing the file on its own schedule, and a negative answer cached before the file existed survives until reboot.

Both scripts now end with dscacheutil -flushcache and a HUP of mDNSResponder, each line tolerant of the tool being absent so the undo script still succeeds on a host without them (set -eu and all). The undo script flushes after the resolver file is gone, so its cached answers do not outlive it.

Verification

  • cargo fmt --all --check — clean
  • cargo clippy --workspace --all-targets --locked -- -D warnings — clean
  • cargo test --locked -p minimal — 524 passed, 1 pre-existing failure (legacy_network_spellings_parse_with_hint, a CLI network-flag hint test unrelated to resolver code; it fails identically on unmodified main, confirmed by stashing this change and re-running it)
  • cargo test --locked -p minimal --lib resolver — 83 passed, including the new macos_scripts_flush_the_system_resolver_cache test

live-session: macos e2e (.github/workflows/ci-macos.yml) — runs on this PR; not runnable in the fixer sandbox.

Summary by CodeRabbit

  • Bug Fixes
    • macOS setup and undo now refresh the DNS resolver cache after their changes, helping resolver updates take effect without relying on stale cached entries. Failure to refresh the cache does not interrupt either operation.

min finalize-install writes /etc/resolver/min.internal but its install
and undo scripts never ask configd or mDNSResponder to re-read the
resolver configuration or drop the cached answers, so pickup depends on
the system noticing the file on its own schedule and a negative answer
cached before the file existed survives until reboot.

Both scripts now end with dscacheutil -flushcache and a HUP of
mDNSResponder, each tolerant of the tool being absent so the undo script
still succeeds on a host without them. The undo script flushes after
the resolver file is gone so its cached answers do not outlive it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gominimal-aw-bot
gominimal-aw-bot Bot requested a review from a team as a code owner October 17, 2026 15:37
@gominimal-aw-bot gominimal-aw-bot Bot added the agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. label Oct 17, 2026
@gominimal-aw-bot

Copy link
Copy Markdown
Contributor Author

[inbox-patch:clobber]

This PR would revert recently merged work

Simulating this merge shows it undoing commits that landed on the base branch within the last 3 day(s):

  • 6c235fece — 100% of its 9 surviving lines in these files would be undone
    • fix(minimal): give each local-range alias a /32 mask (fix(minimal): give each local-range alias a /32 mask #2196)
      This is the stale-read failure, not a conflict: the agent read these files before the commits above merged, then wrote the whole region back from that stale read. Git applies it cleanly, so there is no conflict, no failing test, and nothing unusual in the diff summary — see gominimal/inbox#460.

Before merging, restore the reverted region to its state on the base branch. The rest of this PR is unaffected.

If a listed commit is one this PR intends to supersede, say so and merge — this check reports, it does not block.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: ddbf38b3-b6ef-49f4-bd6b-6a7c3d282b05
📥 Commits

Reviewing files that changed from the base of the PR and between b2acb8c and ee6ff05.

📒 Files selected for processing: 1
  • crates/minimal/src/resolver.rs

Included review availability: This review used your included allowance. Your plan provides up to 5 included reviews per hour; 0 remain after this review.

📝 Walkthrough

The macOS install and undo scripts now flush the resolver cache and send HUP to mDNSResponder. Both commands tolerate failure. A test checks that the commands follow the relevant setup or removal steps.

Changes: macOS resolver cache flushing

Layer / File(s) Summary
Install and undo cache flushing
crates/minimal/src/resolver.rs
The install script runs best-effort cache-flush and mDNSResponder reload commands after setup. The undo script runs the same commands after removing the resolver file and attempting to remove its directory. A test checks command placement for both scripts.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: norrietaylor

Merge Risk: ⚪ Minimal · up to ee6ff

Successful macOS installs and undos refresh resolver caches after changing resolver configuration, while refresh-command failures remain nonfatal. No concrete merge risk remains.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title uses the required Conventional Commit format and clearly describes the macOS resolver-cache change.
Description check Passed The description explains the change, motivation, testing performed, known pre-existing failure, and E2E status. It omits the template's Checklist section and uses What and Verification instead of Summ…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files.
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.
Full details: Description check

Explanation

The description explains the change, motivation, testing performed, known pre-existing failure, and E2E status. It omits the template's Checklist section and uses What and Verification instead of Summary and Testing, but the required information is substantially present.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the resolver’s trail
Cache commands hop in after setup
Then HUP taps softly at the door
Undo clears the path once more
Tests watch each step in place
The rabbit bounds away with grace

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

@gominimal-aw-bot gominimal-aw-bot Bot added clobber-suspected agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch labels Oct 17, 2026
@norrietaylor norrietaylor changed the title fix: Flush the macOS system resolver cache in the finalize-install scripts fix(minimal): flush the macOS system resolver cache in the finalize-install scripts Oct 18, 2026
@norrietaylor

Copy link
Copy Markdown
Member

/review

@minimal-foundry

minimal-foundry Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Approved: no findings at 528f161b996d.

Nothing to do.

Clobber: none: git log -- crates/minimal/src/resolver.rs shows only this PR's two commits on top of unrelated prior work; nothing reverted.

@minimal-foundry minimal-foundry 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.

minimal-review — advisory review

Verdict COMMENT — No findings.

Panel: 2 of 3 personas ran (correctness, security); did not complete: supply-chain.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 18, 2026

@norrietaylor norrietaylor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved on ARCH PASS at 528f161.

@norrietaylor
norrietaylor added this pull request to the merge queue Oct 18, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 18, 2026
@norrietaylor
norrietaylor added this pull request to the merge queue Oct 18, 2026
Merged via the queue into main with commit 9ea9433 Oct 18, 2026
35 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/macos-resolver-flush-6c42c90469a5af5f branch October 18, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch clobber-suspected review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant