Skip to content

Refactor bdns to remove usage of deprecated net.Error.Temporary() method #8439

@sheurich

Description

@sheurich

Problem

The Boulder bdns package currently uses the net.Error.Temporary() method to determine if DNS query failures should be retried. However, according to golang/go#45729, the Temporary() method is deprecated because its meaning is poorly defined, mostly redundant with Timeout(), and its exceptions are surprising or not useful. Go recommends not using Temporary() for retry logic.

Affected Code

  • The main retry logic in bdns/dns.go (see inside exchangeOne) relies on Temporary() to decide if a DNS or DoH query should be retried with another resolver.
  • Several tests in bdns/dns_test.go and test mocks implement the Temporary() method for error types, which should be updated to reflect the deprecation and changed logic.

Proposed Solution

  • Refactor bdns/dns.go to remove the usage of Temporary().
  • Switch retry logic to rely on Timeout() and/or explicit error types that are well understood and documented.
  • Update all affected test cases and mocks to use the new error handling approach.

References

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