Skip to content

socket.getfqdn is slow on macos-15 and macos-26 runners with python installed from setup-python #1223

@glandium

Description

@glandium

Description:
socket.getfqdn is slow on macos-15 and macos-16 runners with setup-python's python, as opposed to the pre-installed python or python installed from uv.

Action version:
5

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
At least 3.11, 3.12, 3.13

Repro steps:
Running the following script:

import socket
import time

def measure(func):
    start = time.monotonic()
    func()
    stop = time.monotonic()
    print(stop - start)

measure(lambda: socket.getfqdn("127.0.0.1"))
measure(lambda: socket.getfqdn("localhost"))
measure(lambda: socket.getfqdn("localhost."))
measure(lambda: socket.getfqdn("localhost.localdomain"))
measure(lambda: socket.getfqdn("localhost.localdomain."))

yields results that take > 30s for the first two socket.getfqdn calls and sub-second for the other three.
It does not happen on macos-13 and macos-14 runners. Only macos-15 and macos-26. That could indicate some DNS configuration weirdness or OS-level difference, but it also doesn't happen on macos-15 and macos-26 when using uv's python.
It also happens with the pre-installed python 3.11 (but not 3.12 or 3.13) on the macos-15 runners, and all the pre-installed python versions on the macos-26 runners.

See this action run:
https://github.com/glandium/gha-mac-fqdn/actions/runs/18391091149/job/52401252752

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions