Skip to content

Apply DNS updates safely and remove rejected zones #276

Closed

Description

@ecv

Summary

Close the remaining gaps in configuration updates, domain validation, address cleanup, and update tests.

Why it matters

Overlapping updates can stall the service, while rejected domains can leave old answers behind or claim names reserved for the platform.

Acceptance criteria

  • An update that times out cannot overlap the next update, and a stuck server does not hold up updates to other servers.
  • Cancelling one request does not discard identical updates that are still needed by other callers.
  • A network context rejected for its domain no longer retains its managed zone.
  • DNS suffix settings reject one-label public names and protect the platform’s own reserved names.
  • Address cleanup has a defined cost limit or benchmark as the number of projects and addresses grows.
  • Tests exercise a required-version change, and documentation explains when a network-binding change intentionally pauses serving.

Related work

Parent: Keep Private DNS working through updates and failures.

Original report and engineering evidence are preserved in the discussion.

Activity

  1. ecv commented on Oct 22, 2026

    @ecv
    ContributorAuthor

    File-level detail, as of #265 at 1e1044d, #266 at 137a23d and #268 at 34ce278:

    1. internal/internaldns/serving/serial_runner.go: Run wraps the delegate in context.WithTimeout(context.WithoutCancel(ctx), daemonCommandLimit) (30s), and ExecRunner uses exec.CommandContext, which kills only the direct child. The comment "a started session runs to completion" is false once the timeout fires. Either kill the process group and wait for the daemon, or document the cap. The queue is one per runner, not per daemon.
    2. Same file: a joiner waits on call.done. If the owner is cancelled while queued, finish(call, nil, ctx.Err()) hands the joiner context.Canceled. Let a live joiner take over the call instead.
    3. internal/internaldns/serving/update_log.go: Rules counts appendRule( anywhere, including in comments. A failure logs an Error line and returns the same error, so it shows twice.
    4. internal/internaldns/controlplane/context_reconciler.go: on InvalidManagedDomain only status is cleared; the managed DNSZone and DNSZoneAssociation stay. The status-clear condition !Enabled || invalidDomain also stops clearing the managed namespace for contexts invalid for other reasons, such as a duplicate consumerID.
    5. internal/internaldns/runtime/config.go: managedDomainSuffixes accepts a single-label suffix. Require two or more labels, or reject public suffixes, and consider a reserved list for platform zones such as datum.internal.
    6. internal/internaldns/platform/allocator.go: ReleaseDestinations lists all lease ConfigMaps per project per reconcile. deleteClaim swallows Conflict in reserve; it heals on the next pass, but a test would pin it.
    7. internal/internaldns/serving/coredns_test.go: add a step where RequiredPublicationEpoch/Revision rises while a member is behind, and assert the intended SERVFAIL.
  2. added theissue type on Oct 29, 2026
  3. scotwells commented on Oct 29, 2026

    @scotwells
    Contributor

    The description now explains the problem and expected outcome in plain language. The original report is preserved below for the observations, diagnostics, and implementation details behind this work. It describes the situation when the issue was reported; later comments and the issue state record subsequent progress.

    Original report and engineering evidence

    Private DNS fixes in fix: Keep private DNS answering during zone updates, fix: Serialize and log private DNS forwarder updates and fix: Free private DNS destination claims and refuse unsafe domains leave a few gaps that can stall updates, leave old zones in place, or let config reopen the domain check.

    1. Forwarder updates now give up after 30 seconds. On a timeout only the client process dies, so the next update can still overlap a session the daemon is applying. One queue also covers every daemon, so one stuck push holds up the others.
    2. When a queued update is cancelled, any identical update that joined it fails with the cancelled error and does not run.
    3. A context refused for its domain stops being Ready, but its existing zone stays in place.
    4. Config can permit a one-label suffix such as com, and the platform's own datum.internal is open to any tenant context.
    5. Releasing addresses lists every lease in the platform namespace for each project on each pass, so its cost grows with projects times claims.
    6. fix: Keep private DNS answering during zone updates's test never raises the required version above what a member holds, and its body does not say that a binding change still empties the pool by design.

    Done when a timed-out update cannot overlap the next, joined updates survive a cancelled owner, refused contexts lose their zone, the suffix list refuses one-label and platform names, and the release path has a bound or a benchmark. The file-level detail is in the first comment.

    Related to fix: Keep private DNS answering during zone updates
    Related to fix: Serialize and log private DNS forwarder updates
    Related to fix: Free private DNS destination claims and refuse unsafe domains

  4. changed the title [-]Private DNS updates can overlap after a timeout and refused zones linger[/-] [+]Apply DNS updates safely and remove rejected zones[/+] on Oct 29, 2026
  5. scotwells commented on Oct 29, 2026

    @scotwells
    Contributor

    Fresh low-rate staging validation on 29 October found three isolated private-query transport timeouts outside the approved shared-resolver restart: TCP through fd53::53 at 20:25:48 UTC, UDP through fd53::54 at 20:37:02, and UDP through fd53::53 at 20:40:53. Each query had a one-second budget. The first two coincided with isolated Workload replacements; the third occurred while that target was stable, during broader test activity. Public-name controls continued to answer. The cause is not proven, so this is not evidence that the earlier fix in #264 is absent.

    Separately, the sustained crash test correctly withdrew the positive address to NODATA on all four private lookup paths and restored it after recovery. Deletion/recreation with a changed allocation also removed the old address and served the new one without returning the old address during the observed window beyond TTL. Expected NODATA/NXDOMAIN during these transitions was not counted as a transport failure.

    Next: correlate query timestamps with required/applied publication revisions, forwarding connections and server selection during repeat low-rate testing, including a stable control name. Add a real-path regression asserting DNS responses while preserving intentional withdrawal semantics. Current majority staging serving digest is 215158266038990698fb55956624f3bc1c4a342d38df7d9908a12026f9f84427; runtime is 496d0dd388762c2f668be703e27c8267e719f6700ddb62fc216f70a02515d950. No shared software upgrade was performed.

  6. self-assigned this
    on Oct 29, 2026
  7. scotwells commented on Nov 5, 2026

    @scotwells
    Contributor

    Fixed by #481 (the remaining items were already fixed on main) and verified in staging. Both labs run a main build that includes it. Over about 2.5 hours, 811 configuration updates were applied and none failed. The slowest took 72 ms, well under the 30 s limit. No timeouts, killed commands, cancelled shared updates, or dnsdist helper errors were logged, and updates are still applying. Logs were checked in the central lab; the east lab runs the same build with no restarts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions