Skip to content

Cache collisions in matrix jobs causing long hangs #672

@amaschas

Description

@amaschas

Description:
The cache key is generated via:

const primaryKey = `setup-go-${platform}-${arch}-${linuxVersion}go-${versionSpec}-${fileHash}`;

If a matrix job is defined where these parameters are the same for each job, the cleanup step for all but one of the jobs will hang for ~2 minutes trying to create the cache.

Action version:
Specify the action version
v6.0.0

Tools version:
N/A

Repro steps:

Attempt a matrix like this:

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        test: [ '1', '2' ]
    name: Test Job
    steps:
      - name: Setup go
        uses: actions/setup-go@v6
      - run: echo "matrix run ${{ matrix.test }}"

Expected behavior:
The job should either gracefully (and quickly) complete upon realizing the cache key already exists, or a configuration option should be supplied to users to allow for custom cache keys.

Actual behavior:
The first matrix to complete will populate the cache, the second will hang for a few minutes until it figure out that the cache key already exists then complete.

Metadata

Metadata

Assignees

No one assigned

    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