Skip to content

MDEV-40955 mysql_client_test needs a resolvable DNS on Linux - #5618

Open
vaintroub wants to merge 1 commit into
10.11from
10.11-MDEV-40955
Open

MDEV-40955 mysql_client_test needs a resolvable DNS on Linux#5618
vaintroub wants to merge 1 commit into
10.11from
10.11-MDEV-40955

Conversation

@vaintroub

@vaintroub vaintroub commented Aug 31, 2026

Copy link
Copy Markdown
Member

Summary

  • test_proxy_header_connect_errors_reset() relies on 192.0.2.50 (RFC 5737) failing reverse DNS lookup permanently; on Linux, an unreachable resolver reports EAI_AGAIN (temporary) instead, which is excluded from connect-error accounting and silently defeats the max_connect_errors check.
  • Fixed by forcing the deterministic outcome via the existing getnameinfo_error_noname debug point, same as sibling tests. Debug-only.

Test plan

  • main.mysql_client_test / _comp / _nonblock pass with network intact (Windows + Linux debug build)
  • Same suites pass with DNS fully unreachable (Linux, network-namespace isolation)
    unshare --net --map-root-user bash -c 'ip link set lo up && perl mysql-test-run.pl --suite=main main.mysql_client_test'
  • Confirmed unpatched test passes on Windows with DNS blocked (not affected; Linux/glibc-specific)

The test test_proxy_header_connect_errors_reset() relies on 192.0.2.50
(test IP, per RFC 5737) failing reverse DNS lookup permanently, which is
what a real, working resolver reports for it. Linux's resolver isn't so
RFC-compliant, when it has no route to any nameserver at all: it reports
EAI_AGAIN (temporary) instead, which is deliberately excluded from
connect-error accounting to avoid blocking hosts during a DNS outage.
That silently defeats the max_connect_errors check this test exercises.

Fix by forcing the deterministic "permanent failure" outcome via the
existing getnameinfo_error_noname debug instrumentation, same as its
sibling tests. Debug-only, like those siblings, since the workaround
needs DBUG_EXECUTE_IF.

Assisted-By: Claude Sonnet 5 <noreply@anthropic.com>
@vaintroub
vaintroub requested review from vuvova and a lite review from Copilot August 31, 2026 18:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR makes test_proxy_header_connect_errors_reset() in mysql_client_test deterministic on Linux by using an existing debug injection point to force a stable reverse-DNS failure mode (EAI_NONAME), avoiding test flakiness when resolvers are unreachable.

Changes:

  • Wrap test_proxy_header_connect_errors_reset() in #ifndef DBUG_OFF to ensure the new debug-point behavior is debug-only.
  • Save/override @@global.debug_dbug to enable getnameinfo_error_noname during the test and restore it afterward.
  • Keep existing connect-error and max_connect_errors assertions unchanged while making the DNS outcome stable.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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

Development

Successfully merging this pull request may close these issues.

3 participants