Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache: too slow cleanup #1578

Open
smorimoto opened this issue Nov 4, 2023 · 12 comments
Open

cache: too slow cleanup #1578

smorimoto opened this issue Nov 4, 2023 · 12 comments

Comments

@smorimoto
Copy link
Contributor

I'm opening this issue as a blank issue because it's still not clear if this is a bug!

For some reason, calling the cache save function in the post phase seems to cause a lot of blank time after uploading the cache. This did not happen until a few months ago, if I remember correctly. I just want to check if the actions team has a clear idea of what caused this.

@smorimoto
Copy link
Contributor Author

Reference to a possibly relevant issue: actions/cache#597

@smorimoto
Copy link
Contributor Author

I worked around this problem with this approach: ocaml/setup-ocaml#724

@Kith330
Copy link

Kith330 commented Nov 25, 2023

818449

@lazka
Copy link
Contributor

lazka commented Jan 6, 2024

We are hitting the same issue at https://github.com/msys2/setup-msys2, 2 minutes hangs after everything is executed and a cache was saved before.

I did some testing and I can confirm that downgrading to node16 from node20 fixes the issue (can anyone confirm this?). So it seems like a bug to me.

I can also confirm that calling process.exit fixes it as well.

@smorimoto
Copy link
Contributor Author

It's definitely a bug, but it's weird how changing the runtime changes the behaviour. I will look for the cause.

@lazka
Copy link
Contributor

lazka commented Jan 6, 2024

I don't know much about node, but using process.getActiveResourcesInfo() at the end shows that there are three TCPSocketWrap still active, while they aren't with node 16, or if no cache is uploaded.

lazka added a commit to lazka/setup-msys2 that referenced this issue Jan 6, 2024
Starting with the update to node20, in case we would call
the GH cache upload functions the process would not exit
right away, but stay around for 1-2 minutes doing nothing.

See actions/toolkit#1578 for the upstream issue.

Work around by forcing node to exit.

Fixes msys2#346
lazka added a commit to lazka/setup-msys2 that referenced this issue Jan 6, 2024
Starting with the update to node20, in case we would call
the GH cache upload functions the process would not exit
right away, but stay around for 1-2 minutes doing nothing.

See actions/toolkit#1578 for the upstream issue.

Work around by forcing node to exit.

Fixes msys2#346
lazka added a commit to lazka/setup-msys2 that referenced this issue Jan 6, 2024
Starting with the update to node20, in case we would call
the GH cache upload functions the process would not exit
right away, but stay around for 1-2 minutes doing nothing.

See actions/toolkit#1578 for the upstream issue.

Work around by forcing node to exit.

Fixes msys2#346
lazka added a commit to msys2/setup-msys2 that referenced this issue Jan 6, 2024
Starting with the update to node20, in case we would call
the GH cache upload functions the process would not exit
right away, but stay around for 1-2 minutes doing nothing.

See actions/toolkit#1578 for the upstream issue.

Work around by forcing node to exit.

Fixes #346
nonrational added a commit to parallel-markets/cache-result-action that referenced this issue Feb 27, 2024
nonrational added a commit to parallel-markets/cache-result-action that referenced this issue Feb 27, 2024
* Use process.exit() to mitigate actions/toolkit#1578

* package, upgrade dependencies, rev 2.0.1

* use node20 locally

* ci-bump

* trim trailing whitespace

* repackage
0xbe7a added a commit to 0xbe7a/setup-pixi that referenced this issue May 23, 2024
@dkrieger
Copy link

dkrieger commented Jul 8, 2024

this appears to be affecting steps using actions/cache/save@v3 as well

@rmnoon
Copy link

rmnoon commented Jul 26, 2024

For anybody else running into this: the 2m delay on save went away when I switched to explicit save/restore on v4 (but not v3).

@almirsarajcic
Copy link

almirsarajcic commented Nov 29, 2024

Thank you, @rmnoon. It worked!
Whoever doesn't believe, check optimumBA/phx.tools#28 😃

@erikburt
Copy link

This is still present in @actions/cache v4.0.0. I added a cache to my reusable JS action, and immediately noticed a 2 minute hang in exiting the action only after calling saveCache.

@erikburt
Copy link

Not sure but it seems like it could be due to this:

@agent-reed
Copy link

Also running into this ~2m hang using actions/cache@v4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants