runner-images icon indicating copy to clipboard operation
runner-images copied to clipboard

Poor performance of Python socket module on MacOS 15 runner

Open MetRonnie opened this issue 9 months ago • 6 comments

Description

socket.getfqdn() is taking more than 1 minute to run for some reason!

Platforms affected

  • [ ] Azure DevOps
  • [x] GitHub Actions - Standard Runners
  • [ ] GitHub Actions - Larger Runners

Runner images affected

  • [ ] Ubuntu 22.04
  • [ ] Ubuntu 24.04
  • [ ] macOS 13
  • [ ] macOS 13 Arm64
  • [ ] macOS 14
  • [ ] macOS 14 Arm64
  • [x] macOS 15
  • [x] macOS 15 Arm64
  • [ ] Windows Server 2019
  • [ ] Windows Server 2022
  • [ ] Windows Server 2025

Image version and build link

macos-15-arm64 20250428.1341

https://github.com/MetRonnie/muldoon/actions/runs/14890924049/job/41822518502

Is it regression?

Yes, see macos-14-arm64 20250505.1431 run: https://github.com/MetRonnie/muldoon/actions/runs/14890924049/job/41822518514

Expected behavior

socket.getfqdn() should take ~1s or less

Actual behavior

It's taking more than 1 minute to run.

Repro steps

- shell: python
  run: |
    import socket
    socket.getfqdn()

(I have checked that import socket does not take an undue amount of time by running it alone in a different step)

MetRonnie avatar May 08 '25 09:05 MetRonnie

Hi @MetRonnie, We will look into the issue and keep you posted with updates. Thanks.

aartis17 avatar May 08 '25 10:05 aartis17

Hi @MetRonnie, I have reviewed the workflow you provided and observed that socket.getfqdn() takes more than 1 minute to execute on the macos-15 image. However, on the macos-15-large image with 3.9 python version, it executes in seconds. please see below snip:

  • macos-15-large image with 3.9 python version :
Image
  • For workaround , you can use the command socket.gethostname() along with import socket for faster execution.
Image

We are continuing to investigate the root cause of the delay when using socket.getfqdn() on the macOS-15 image. Thank you for your patience!

aartis17 avatar May 14 '25 06:05 aartis17

Hi @MetRonnie, Following up on my previous comment regarding error on macOS-15 runners, have you had a chance to review the information and the suggested recommendation above? Thanks.

aartis17 avatar May 19 '25 11:05 aartis17

We are currently not using MacOS-15 runners (I think macos-latest is still 14?) so happy to wait for a fix. Changing our usage of socket in our application due to performance problems on one GH Actions system is a no-go, however

MetRonnie avatar May 27 '25 10:05 MetRonnie

@MetRonnie 👋 Thank you for your patience. We are still investigating the issue, stay tunned. Thanks.

aartis17 avatar Jun 05 '25 08:06 aartis17

Hi @MetRonnie , Work is still in progress. I’ll let you know as soon as there’s an update, thank you.

aartis17 avatar Jun 18 '25 11:06 aartis17

Hi @MetRonnie 👋 , As a result of our investigation, we found out that the problem is related to changes in the security system that have been applied since macOS-15. In fact, your problem is in a broad sense a duplicate and/or a consequence of this issue: https://github.com/actions/runner-images/issues/10924, where the specified problem was highlighted for the first time. We recommend that you monitor changes in the original issue. If we have new information about the fix, it will be published there. If we go into detail, we noticed that your code on the new OS causes a request for privilege escalation. If this request is not confirmed or denied, then the pause you specified occurs, after which the process continues anyway. Thank you.

aartis17 avatar Jul 02 '25 13:07 aartis17

Hi @MetRonnie , We request you to monitor the original issue : https://github.com/actions/runner-images/issues/10924, for updates regarding a fix. Closing this issue for now and If the issue still persists, please feel free to open a new ticket. Thank you

aartis17 avatar Jul 14 '25 13:07 aartis17