runner icon indicating copy to clipboard operation
runner copied to clipboard

Make timeout for `hashFiles()` configureable

Open Carsten-MaD opened this issue 2 years ago • 5 comments

As reported here https://github.com/actions/runner/issues/1840, in scenarios where a lot of files need to be hashed to build up a cache, the process running hashFiles() may run into the fixed 120 second timeout and be cancelled prematurely.

This pull request introduces a new parameter --timeout= that is meant to be passed the same way as the already existing optional parameter --follow-symbolic-links.

Example configuration for actions/cache:

- uses: actions/cache@v3
  with:
    key: ${{ runner.os }}-${{ hashFiles('--timeout=600', '**') }}

Points of discussion:

  • It may be controversial to pass a parameter that affects the timeout of a process like this, as it is not directly related to the hashFiles() command itself, but rather to how it is run. If you see an alternative way of injecting such a parameter, please let me know.
  • For this, I removed firstParameter and the connected logic. Instead, the logic now looks for if a parameter name starts with -- and tries to match one of the two expected parameters. Please let me know if you strongly feel the logic that these parameters need to be first is needed, I will then put something in.
  • There are two different exceptions thrown for when the timeout number could not be parsed (e.g. a string passed), and when it was empty. This could be made into one more generic exception to handle and explain both.

Carsten-MaD avatar Apr 22 '22 15:04 Carsten-MaD

Not entirely sure, is there anything I need to do so the PR is reviewed, am I missing a step?

@TingluoHuang sorry if I tag you directly, maybe you can advise?

Carsten-MaD avatar May 05 '22 07:05 Carsten-MaD

This Pr is really needed for us large gamedev project users, any update on this ?

shubhank008 avatar Dec 15 '22 04:12 shubhank008

This Pr is really needed for us large gamedev project users, any update on this ?

Agree! (realizing I'm replying to a comment from 10 mo ago)

gotchipete avatar Oct 20 '23 16:10 gotchipete

Any updates for this issue or this should be closed? We caught the same error and suspect our runner fails because we have large files to hash and it could go over 120s in many cases.

haoming29 avatar Dec 12 '23 20:12 haoming29

Hey guys, we're running into the same issue with the 120 second hashFiles() timeout. Can we merge this please?

alb3rtuk avatar Apr 26 '24 00:04 alb3rtuk

So what's the status on this?

Propagant avatar May 15 '24 20:05 Propagant

Bump?

AryanJ-NYC avatar Jun 10 '24 13:06 AryanJ-NYC