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

Explicitly exit the process to not wait for hanging promises #907

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xiniria
Copy link

@xiniria xiniria commented Nov 27, 2023

Description:
Since Node.js 19, the default for keepAlive was changed from false to true. As explained in this similar issue for the Ruby setup action, this causes the Post setup Node action to hang for somewhere between 1 and 5 minutes after running. This PR explicitly exits the process once the run function is completed, to not wait for hanging promises.

Related issue:
Fixes #878

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@xiniria xiniria requested a review from a team as a code owner November 27, 2023 15:16
@xiniria xiniria mentioned this pull request Nov 27, 2023
5 tasks
@Bo98
Copy link

Bo98 commented Nov 29, 2023

Change works as a quick fix, but it's worth noting the proper fix would be to merge actions/toolkit#1572 (or a similar fix on actions/toolkit level) otherwise we'd be copy pasting this exit process hack to tons of other actions/* that cache internally as they update to Node 20.

@xiniria
Copy link
Author

xiniria commented Nov 29, 2023

Change works as a quick fix, but it's worth noting the proper fix would be to merge actions/toolkit#1572 (or a similar fix on actions/toolkit level) otherwise we'd be copy pasting this exit process hack to tons of other actions/* that cache internally as they update to Node 20.

I totally agree, but since we have no leverage over when (or even if) this other PR is merged, this should improve things for a lot of users out there in the meantine, don't you think?

@Bo98
Copy link

Bo98 commented Nov 29, 2023

Yeah for sure. Though given GitHub control both repositories, there's a chance the right person will see it here.

External contributions to actions/toolkit are not currently being reviewed (and haven't for a year) so it felt it was worth mentioning in case they want to make a similar fix themselves. If the toolkit and setup-node teams are totally separate and usually don't collaborate then yeah I imagine merging your workaround makes sense.

@xiniria
Copy link
Author

xiniria commented Dec 4, 2023

@nikolai-laevskii could you have a look at the PR?

@xaviermarchal
Copy link

@nikolai-laevskii any news on this PR that could help us a lot on our delivery?

@ehasnain
Copy link

ehasnain commented May 15, 2024

It would great to have this simple fix merged. It's not blocking, but somehow nice to have, as these ~5 Minutes do sum up to a huge number of minutes for teams with large number of developers and multiple builds with every commit.
Thank you @xiniria the PR.

@Bo98
Copy link

Bo98 commented May 15, 2024

It's already fixed: ec97f37

And now double-fixed by the @actions/http-client update: c2ac33f

@ehasnain
Copy link

ehasnain commented May 15, 2024

Hi @Bo98 thanks for the quick update. Not sure why but we are still experiencing 4-5 Minutes of duration in the post step.

image
image
image

We are using actions/setup-node@v4 with node-version: 20.11 on multiple pipelines.
Maybe here is not the right spot for the bug/issue reporting, but I landed here on going through the past issues and PRs related to the same.

@Bo98
Copy link

Bo98 commented May 15, 2024

1GB cache is fairly large. Can you confirm with the "Show timestamps" option that it's actually hanging after the Cached saved with key line?

@ehasnain
Copy link

Hi @Bo98, your guess is right. The size of 1 GB is actually taking quite long. The step ends right after Cache saved with key: ... is logged.
image

Although a compression of similar data (size and number of files), run manually on the same server and disk takes just seconds. I'll try to dig in further. Thank you already for looking into this.

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 this pull request may close these issues.

Slow post-action after v4
5 participants