actions / actions/runner

Pipes appear to not pass on EOF on macOS runners

Open
#884 13 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Runner Bug
Dominant language
C#
Stars
6.3k
Forks
1.4k
Avg merge
1d 16h
Merged PRs (30d)
24

Description

Describe the bug

(first reported at https://github.com/actions/virtual-environments/discussions/2352)

Using yes | some_script anywhere in a workflow on macOS hangs forever. some_script will terminate but yes will keep going, blocking the rest of the workflow.

To Reproduce

I've made a minimal test case here: https://github.com/kousu/hanging-actions/. It basically just tests:

yes | head -n 7

plus collecting some context for debugging.

To reproduce, just fork my repo and watch its Actions tab. Linux (and Travis!) will pass easily, but Actions on macOS hangs until cancelled.

Expected behavior
All platforms should succeed in approximately the same time and way.

Runner Version and Platform

From my logs:

Request a runner to run this job
  • Current runner version: '2.275.1'
Operating System
  • Mac OS X
  • 10.15.7
  • 19H15
Virtual Environment

Thanks to @maxim-lobanov we know that it only happens under actions/runner, and not under https://github.com/microsoft/azure-pipelines-agent (even though azure pipelines runs the same macOS images) or when connected over VNC or ssh.

What's not working?

The symptom is that the Linux builds finish immediately while the macOS build hangs in yellow forever:

2020-12-25-043804_590x265_scrot

In fact even Travis on nearly (but not exactly the same) version of macOS works fine.

For example, consider this Actions Workflow and this this Travis script for comparison, everything finishes in about a minute except for Actions-macOS.

This should only take a moment to finish, and on Travis it does:

2020-12-25-044911_991x287_scrot

but on Actions it's at 3 minutes and counting. I've had jobs hung much longer too -- up to their 6 hour limit -- before I noticed what was going on:

2020-12-25-043814_969x287_scrot

The only way to stop the job is to cancel it. It never undeadlocks.

Job Log Output

Runner and Worker's Diagnostic Logs

I don't have access to these! If I install a runner locally and reproduce there I'll update this.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the minimal reproduction in .github/workflows/yes.yml and compare the linked Actions macOS, Actions Ubuntu, and Travis logs. Investigate the runner behavior around yes | head -n 7; done means the macOS workflow exits promptly like the other platforms without requiring cancellation.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
ci-cd, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.