By NHI Mgmt Group Editorial TeamDomain: Cyber SecuritySource: SemgrepPublished August 20, 2025

TL;DR: A timeout in DNS-over-TLS connection handling surfaced during an OCaml migration, exposing how sequential connection attempts, unclear timeout propagation, and incomplete fallback logic can break modern client networking in CI environments, according to Semgrep. The case shows that resilience in networked tooling depends on concurrency, not just longer timeouts.


At a glance

What this is: This is a systems debugging and network resilience post showing how an OCaml HTTP client hit timeouts because happy-eyeballs and DNS-over-TLS fallback logic were incomplete.

Why it matters: It matters because security and platform teams rely on networked build, scan, and update pipelines that can fail silently when connection logic, retries, and timeout handling are not designed for real-world network conditions.

👉 Read Semgrep's analysis of the OCaml happy-eyeballs timeout bug


Context

Modern network clients often fail not because a service is down, but because connection logic assumes the network behaves in a simple, single-path way. In this case, the primary issue was a timeout in the client stack used during CI, which points to a broader reliability problem in tooling that depends on DNS, HTTP, and layered fallback behaviour. For identity and security teams, the practical parallel is that access paths and control paths both need deterministic failure handling, not optimistic assumptions about connectivity.

The article sits in the cyber_broad domain, but it still has an identity-adjacent governance angle: the same operational fragility that breaks DNS and HTTP clients can also break access to security controls, policy engines, and developer tooling that depend on remote services. That makes connection management part of operational resilience, not just a low-level implementation detail. The behaviour described here is typical of complex distributed tooling, where one hidden dependency can dominate the failure mode.


Key questions

Q: How should teams design retry logic for remote security tooling?

A: Design retry logic so one slow or silent failure cannot block the whole request path. Use concurrent fallback where appropriate, separate DNS from HTTP timing, and ensure cancellation is explicit when a later attempt succeeds. The goal is deterministic recovery, not just longer waits on a single connection attempt.

Q: Why do DNS failures often look like application timeouts?

A: Because DNS is usually the first network dependency in the request chain, and a stalled resolver prevents the application from ever reaching HTTP. If the client does not propagate resolver errors clearly, the visible symptom becomes a generic timeout. That is why transport-level telemetry matters as much as app-level logs.

Q: What breaks when connection attempts happen sequentially in distributed systems?

A: Sequential attempts assume the first path will fail fast, but silent packet loss can leave the client waiting until the timeout expires. During that wait, alternate addresses or transports remain unused. In practice, sequential logic increases latency, hides root cause, and makes flaky infrastructure look like a single service outage.

Q: How can security teams know whether network fallback is actually working?

A: Measure how often alternate paths are attempted, how quickly they are launched, and whether failed attempts are cancelled cleanly after success. If logs only show a final timeout, the fallback mechanism is not observable enough to trust. Effective resilience requires both behaviour and evidence.


Technical breakdown

Why happy eyeballs exists in modern client stacks

Happy eyeballs is a connection strategy designed to reduce user-visible delay when a hostname resolves to multiple addresses or protocols. Instead of waiting on one path to fail completely, the client starts alternate attempts with a slight delay, usually to prefer a faster or more reliable route. That matters in dual-stack environments, multi-homed servers, and DNS setups where IPv4, IPv6, UDP, TCP, or DNS-over-TLS may behave differently. The bug in this post emerged because the implementation did not fully model failure as a concurrent, layered process.

Practical implication: clients that touch remote services need parallel fallback logic, not only longer timeout values.

How DNS-over-TLS changes the failure surface

DNS-over-TLS adds privacy, but it also adds another network dependency before the HTTP request even begins. The client must connect to a resolver, negotiate transport, and then use that resolver to complete name resolution. If that first connection stalls, the application may report an HTTP failure even though the root problem is in DNS. In this article, the resolver path timed out because the fallback logic did not treat silent packet drops and concurrent attempts as separate states.

Practical implication: treat DNS as part of the availability chain and instrument it separately from application HTTP failures.

Why sequential connection attempts are fragile

A sequential approach assumes the first attempt will either fail fast or succeed, but real networks often drop packets without immediate rejection. In that situation, waiting for a single timeout can block the whole workflow even when another address family, transport, or port would work. The article shows that the implementation initially handled negative responses better than silent timeouts, and it did not propagate timing signals clearly across layers. That is a classic reliability gap in effectful client code.

Practical implication: design retry and cancellation behaviour so one stalled attempt cannot hold the entire request path hostage.


NHI Mgmt Group analysis

Connection resilience is now a governance issue, not only an implementation detail. Modern build and security tooling depends on layered network paths that can fail in different ways, and those failure modes often surface as opaque application errors. When CI, scanners, or policy engines rely on remote config retrieval, a timeout in DNS can look like an HTTP failure and consume operational time. The practical conclusion is that resilience controls must be designed into the client path, not added after outages appear.

Concurrent fallback is the named concept this article illustrates. The core failure was not simply slow networking. It was the absence of concurrent connection attempts with clear cancellation and timeout propagation across layers. That pattern matters anywhere a tool must reach external services reliably, especially when the service chain includes DNS, TLS, and containerised execution. Practitioners should treat concurrency and cancellation as first-class reliability controls.

Security tooling inherits the same brittleness as any distributed dependency chain. A scanner that cannot fetch configuration or policy content becomes less useful precisely when build pipelines need dependable control enforcement. That creates an operational blind spot for IAM-adjacent workflows, developer guardrails, and supply chain checks that depend on remote services. The lesson is to review dependency chains with the same discipline used for access paths and service accounts.

Owning the full stack improves diagnosability and reduces hidden failure modes. The article’s value is not just the OCaml bug fix, but the visibility gained by controlling the networking, DNS, and HTTP layers end to end. That kind of stack ownership makes it easier to trace where failures originate and to prove whether fallback logic really works. The practitioner takeaway is to demand observability across every remote dependency that security tooling depends on.

What this signals

Modern security and developer platforms increasingly fail at the dependency layer first, which means resilience work has to include network path diversity, resolver behaviour, and cancellation semantics. The operational signal for practitioners is simple: if a scanner, policy engine, or build step depends on remote fetches, treat those fetches as control-plane dependencies, not background plumbing.

Dependency chain visibility: teams should be able to explain which remote service caused a failed control action, how long each layer waited, and when fallback took over. That is the difference between a recoverable transient and a pipeline outage that undermines trust in security automation.


For practitioners

  • Map every remote dependency in build and security pipelines Identify where scanners, policy engines, and CI jobs depend on DNS, HTTP, TLS, package registries, or external config services. Separate application failures from transport failures so teams can tell whether the break is in name resolution, connection setup, or the remote service itself.
  • Test fallback paths under silent-drop conditions Validate behaviour when packets are dropped rather than rejected, because many real failures do not produce explicit negative responses. Use controlled failure injection to verify that alternate addresses, ports, and transports are attempted concurrently instead of waiting on one timeout.
  • Instrument timeout propagation across layers Make sure resolver, transport, and application timeouts are visible in logs and metrics so one stalled dependency cannot masquerade as another. Track how long each stage waits before cancelling or retrying, especially in containerised CI where debugging is harder.
  • Review cancellation and resource cleanup logic Confirm that failed connection attempts close sockets and stop background work when a later attempt succeeds. Without explicit cancellation, retry logic can consume resources, confuse diagnostics, and create the appearance of intermittent network instability.

Key takeaways

  • The article shows that complex client stacks fail when timeout handling is too linear for modern network conditions.
  • The key evidence is the DNS-over-TLS path that stalled long before the visible HTTP error surfaced.
  • Practitioners should verify concurrent fallback, cancellation, and resolver observability anywhere security tooling depends on remote services.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

NIST CSF 2.0, NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST CSF 2.0PR.DS-4The article exposes a dependency-chain reliability issue in operational tooling.
NIST SP 800-53 Rev 5SC-8Transport protection matters because DNS and HTTP depend on secure network exchanges.
CIS Controls v8CIS-12 , Network Infrastructure ManagementConnection-path visibility and resilience depend on managing network infrastructure well.

Apply SC-8 to preserve integrity and confidentiality across resolver and client connections.


Key terms

  • Happy Eyeballs: Happy eyeballs is a client connection strategy that starts alternate connection attempts when multiple addresses or transports are available. It reduces user-visible delay in dual-stack and multi-homed networks by avoiding a single blocked path from stalling the whole request.
  • DNS-over-TLS: DNS-over-TLS is a DNS transport that encrypts name resolution between the client and resolver. It improves privacy, but it also adds another network dependency that can fail before an application reaches HTTP, which means resolver behaviour must be tested as part of availability design.
  • Reset Propagation: The process by which a password change is applied to every system that trusts the credential. In hybrid IAM, propagation is often asynchronous and uneven, so practitioners must validate where the new state lands and where stale access may remain.

What's in the full article

Semgrep's full post covers the debugging detail this analysis intentionally leaves out for brevity:

  • The exact log traces that exposed the DNS-over-TLS timeout path in CI.
  • The OCaml happy-eyeballs interface changes, including concurrent connection attempts and cancellation handling.
  • The resolver behaviour differences between UDP, TCP, and DNS-over-TLS in the test setup.
  • The implementation details behind the final fix across happy-eyeballs, dns-client, and related libraries.

👉 The full Semgrep post covers the resolver traces, connection model changes, and fix details.

Deepen your knowledge

NHI Mgmt Group covers identity security, NHI governance, and agentic AI through independent research, practitioner guides, and the NHI Foundation Level course, the industry's only accredited NHI security programme. Explore it if your role includes identity governance, secrets management, or workload identity decisions.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 2, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org