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

When comparing v4 to v3, significant time difference in the post run process #591

Closed
3 of 5 tasks
kdkdhoho opened this issue Feb 2, 2024 · 12 comments
Closed
3 of 5 tasks
Assignees
Labels
bug Something isn't working

Comments

@kdkdhoho
Copy link

kdkdhoho commented Feb 2, 2024

Description:
When comparing v4 to v3, we noticed a significant time difference in the post run process.

Task version:
Photo reference

Platform:

  • Ubuntu (actions)
  • macOS (local)
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:
Below are the results using v4.
Result Page of v4
image
image

Below are the results using v3.
Result Page of v3
image
image

Expected behavior:
There is no time difference between the two.

Actual behavior:
There was a significant time difference.

@kdkdhoho kdkdhoho added bug Something isn't working needs triage labels Feb 2, 2024
@brenoavm
Copy link

brenoavm commented Feb 2, 2024

I'm having the same issue when running the following actions:

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout Repository
      uses: actions/checkout@v4

    - name: Set up JDK 17
      uses: actions/setup-java@v3
      with:
        java-version: "17"
        distribution: "oracle"
        cache: "maven"

The principal difference for me seems to be on the maven cache, but I don't know if this is the cause of the time difference.
I have updated the action version only because of nodejs16 deprecation.

V3:
setup-java-v3

V4:
setup-java-v4

@HarithaVattikuti
Copy link
Contributor

Hello @kdkdhoho
Thank you for creating this issue. We will investigate it and get back to you as soon as we have some feedback.

@kirillgroshkov
Copy link

We experience the same. We have self-hosted runners, and since recently (might have coincided with the upgrade from v3 to v4) started having Post run hanging and timing out after 8-10 minutes.

image

@fniephaus
Copy link
Contributor

I'm not 100% but it seems this could be caused by the same problem I reported in #596 (comment). Apparently, the http-client is broken on Node 20 because the keepAlive default was changed, see actions/toolkit#1572.

@aparnajyothi-y
Copy link
Contributor

aparnajyothi-y commented Feb 21, 2024

Hello @brenoavm, Thank you once again for creating this issue.
We have investigated about the issue and able to reproduce the issue but there is no major changes in setup-java that affect the performance time from v3 to v4 other than node 20 upgrade. We tried multiple scenarios and found that the this long time duration is due to the dependencies installation time for node20. As per the node.js official documentation for node 20, we found that from node v19, Global instance of Agent uses keep-alive by default for all HTTP client requests .And the current usage is - HttpClient implementation uses globalAgent when RequestOptions.keepAlive is set to false.
Thank you @fniephaus for this reference. The issue resolves after RequestOptions.keepAlive is applied properly on node20 runtime. Please find the screenshot for reference.

image

Please confirm to proceed to close this issue as it is not related to setup-java. Thank you.

@fniephaus
Copy link
Contributor

As I mentioned in #596 (comment), I don't think it's a good idea to close the ticket. The root problem needs to be fixed in @actions/http-client but this action depends on it. Moreover, my understanding is that setup-java and the GHA toolkit which includes @actions/http-client are both maintained by GitHub. Is there no way you can help get actions/toolkit#1572 reviewed and merged?

@djthornton1212
Copy link

@aparnajyothi-y, my investigations as to why this post action now takes an extra 2 minutes to run have led me to this issue.

Like @fniephaus I too am wondering why no one has even reviewed actions/toolkit#1572. There have been 30 something PRs closed since it was opened in October of 2023. I get that there's a lot to be done & it's busy over there, but this is something that's costing companies like my own extra $$$ due to a potential misconfiguration in GitHub's toolkit.

I know 2 minutes may not sound like a lot, but when you're running 50+ builds a day which use this feature, it adds up quick.

@fniephaus
Copy link
Contributor

Could we get an update on this please? In the meantime, a new release was published and it's very unfortunate a fix for this was not included.

@aparnajyothi-y
Copy link
Contributor

aparnajyothi-y commented Mar 1, 2024

Hello @fniephaus, The PR merged and waiting for the release to fix the slow post setup issue. We will update you once the changes released. Thank you.

@aparnajyothi-y
Copy link
Contributor

aparnajyothi-y commented Mar 15, 2024

Hello everyone, The Toolkit PR released and updated actions/http-client version to 2.2.1 as part of setup-java v4.2.0 release. Tested from our end, the time difference in the post run process in v4. Please check and confirm to proceed to close this issue.

@fniephaus
Copy link
Contributor

I can confirm that this is now fixed with v4.2.0. Our builds run 3min faster again. Thank you!

@aparnajyothi-y
Copy link
Contributor

Hello everyone, Closing this issue as the issue resolved and confirmed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants