toolkit
toolkit copied to clipboard
@actions/ccache causing 2min slowdown with Node 20 runtime
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:
- Call
saveCachein 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.