Skip to content

reliability: prevent timed-out DNS workers from exhausting resolver capacity #108

Description

@seonghobae

Buyer-visible availability boundary

EgressWeave bounds caller-facing DNS waits and process-wide resolver concurrency, but an already-running platform socket.getaddrinfo(...) call cannot be safely force-cancelled by Python. The accepted design therefore prevents repeated overlapping validation of the same canonical (hostname, port) from multiplying live resolver workers/slots while retaining a fresh DNS lookup after a live flight completes. This is a bounded availability/resource-amplification boundary, not an SSRF-authority bypass.

Current canonical implementation

Historical #109/#156 and their predecessor heads remain TDD/review history only. The single live reconstruction owner is Draft PR #205reliability: reconstruct DNS single-flight on protected main.

Fresh exact identity:

Runtime contract

One canonical (hostname, port) may share only one live raw DNS lookup. Each caller retains its own finite deadline and independently reapplies address scope, local-development rules, deduplication, and max_resolved_addresses. Completed results are never cached. Worker-start failure releases the resolver slot and removes the live flight without swallowing KeyboardInterrupt or SystemExit; ordinary public failures remain behind the generic non-leaking denial boundary.

Exact-current-head evidence

On unchanged 39332783589c8571f15d77ea60170d918fb82461:

  • repository ci run 31598859748: completed success;
  • required SAST Semgrep run 31598859828: completed success;
  • required Security Scan run 31598859864: aggregate success, but job 94120959500 shows the actual immutable-pinned Dependency review step as skipped; aggregate green is therefore non-passing supply-chain evidence under security: fail closed when dependency review is unavailable #76;
  • formal reviews: none at the latest exact-head refetch.

The separately governed organization repair remains read-only ContextualWisdomLab/.github#897, exact head 59505c1d89eb7ea816e921b6da38079c736608c2, open / Ready / mergeable / unmerged at the latest refetch. Do not add an EgressWeave-local substitute, weaken the gate, invent credentials, or churn this clean source head merely to reproduce the same skipped result.

Acceptance criteria

  • Reproduce same-authority slow-resolver amplification deterministically without public DNS.
  • Establish public sync/async RED evidence before production repair.
  • Keep finite caller waits and finite process-wide resolver work.
  • Share only a live same-authority resolver worker/slot; do not cache completed DNS results.
  • Reapply caller-specific address scope, local-development rules, deduplication, and max_resolved_addresses after shared raw resolution.
  • Count async executor scheduling delay inside the public DNS deadline while preserving caller-directed cancellation.
  • Fail closed on capacity exhaustion, pre-start exhaustion, worker-start failure, empty/incomplete result, resolver failure, and caller timeout.
  • Normalize dependency/resolver/worker-start failures to the stable generic public denial without private exception provenance.
  • Preserve ValidatedEgressURL integrity, exact authority, DNS pinning through connect, TLS identity, proxy isolation, request/response controls, and deterministic cleanup.
  • Reconstruct the unique DNS single-flight delta directly on exact protected main as reliability: reconstruct DNS single-flight on protected main #205 without force-push/destructive rebase and obtain exact-head repository CI/SAST success.
  • Integrate the corrected separately governed central dependency-review repair and obtain a fresh unchanged reliability: reconstruct DNS single-flight on protected main #205 Security Scan whose actual immutable-pinned Dependency review action executes and succeeds.
  • Require every other live organization-required workflow to be genuinely passing on the unchanged exact head; queued/skipped/neutral/backend-unavailable/wrapper-only/status/model/predecessor evidence does not pass by inference.
  • Obtain current semantic/source review with zero valid unresolved findings; formal approval is required only if the live ruleset actually requires it.
  • Immediately before integration refetch exact head, live base, ancestry, ruleset, required workflows, unresolved findings/reviews/threads, and writer evidence; merge only the unchanged accepted tree.
  • Verify the DNS live-flight/resource contract from protected main before closure.

Non-goals

  • No custom recursive DNS resolver or DNSSEC claim.
  • No claim that a Python library can instantly terminate a blocked operating-system resolver.
  • No completed-result cache or stale DNS reuse for availability.
  • No destination-policy, TLS, proxy, request/response, credential, workflow-publisher, release, tag/ref, package-publication, or persistence widening.
  • No EgressWeave-local replacement for organization-owned required workflows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions