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 is slow to save #36

Closed
chrismgrayftsinc opened this issue Sep 18, 2024 · 11 comments · Fixed by #37
Closed

Cache is slow to save #36

chrismgrayftsinc opened this issue Sep 18, 2024 · 11 comments · Fixed by #37

Comments

@chrismgrayftsinc
Copy link
Contributor

Recently a run of Post Setup bazel took around 4 minutes. I wonder if it could be related to actions/toolkit#1578

The workaround mentioned there is to call process.exit() after the caches are saved.

@p0deje
Copy link
Member

p0deje commented Sep 19, 2024

@chrismgrayftsinc Can you try building a version with process.exit() and see if it helps in your case?

@chrismgrayftsinc
Copy link
Contributor Author

I tried and it didn't make much of a difference.

2024-09-23_08-58

I don't really know what is happening in the 2 minutes between when "Successfully saved cache" is printed and the next step is started.

@p0deje
Copy link
Member

p0deje commented Sep 23, 2024

@chrismgrayftsinc Do you have a public fork to see how you built setup-bazel?

@chrismgrayftsinc
Copy link
Contributor Author

@chrismgrayftsinc
Copy link
Contributor Author

Oh whoops I forgot to run npm run build. I'll try again.

@chrismgrayftsinc
Copy link
Contributor Author

Okay, that did make a huge difference.

2024-09-23_09-22

I'll create a pull request with the change.

@michaelschuett-tomtom
Copy link

I had seen this for about a month but never had time to look into it. Getting a version with this published would be awesome. My bazel build takes 5 minutes but the saving cache takes 4 and a half almost all of that is after seeing Successfully saved cache.

p0deje pushed a commit that referenced this issue Sep 23, 2024
@p0deje
Copy link
Member

p0deje commented Sep 23, 2024

@chrismgrayftsinc Thanks! I made a release 0.9.0 with this fix. Can you try it out?

@michaelschuett-tomtom
Copy link

michaelschuett-tomtom commented Sep 23, 2024

@chrismgrayftsinc Thanks! I made a release 0.9.0 with this fix. Can you try it out?

Just verified on my builds. This is a huge improvement. reduced a lot of my lint github action run time by over 50%. Thank you!

@michaelschuett-tomtom
Copy link

Although just one thing to note I just see Post job cleanup. message now and not the other messages anymore. Not sure if it's somehow killing the process too early or this is expected.

@chrismgrayftsinc
Copy link
Contributor Author

Hmm, I am seeing the other messages with my test version. I haven't tried the released version yet.

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

Successfully merging a pull request may close this issue.

3 participants