actions / actions/toolkit

@actions/ccache causing 2min slowdown with Node 20 runtime

Open
#1,643 0 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
Saving cache hangs up the node process causing a 2min slowdown. This is related to https://github.com/nodejs/node/issues/47228. This has caused many Github actions to manually call process.exit() to prevent this slow down. Which I think is bad and can cause unexpected bugs to happen in future.

To Reproduce
Steps to reproduce the behavior:

  1. Call saveCache in your action with Node 20 runtime
import * as core from '@actions/core'
import * as cache from '@actions/cache'

async function run(): Promise<void> {
  try {
    await cache.saveCache(".cache", "cache-bug")
  } catch (error: any) {
    // Show fail error if there is any error
    core.error(error)
    core.setFailed(error.message)
  }
}

run()

Expected behavior
The Node process shouldn't hang up and cause slow down.

Contributor guide

Open the contributing guide

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 saveCache call shown in the reproduction and run it in an action using the Node 20 runtime. Compare the process behavior with the linked Node.js issue; done means saving the cache no longer leaves the process hanging for about two minutes without requiring process.exit().

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.