Skip to content

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

Closed

Description

@kdkdhoho

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.

Activity

  1. brenoavm commented on Feb 2, 2024

    @brenoavm

    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

  2. v-HarithaVattikuti commented on Feb 2, 2024

    @v-HarithaVattikuti
    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.

  3. kirillgroshkov commented on Feb 8, 2024

    @kirillgroshkov

    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
  4. fniephaus commented on Feb 14, 2024

    @fniephaus
    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.

  5. v-aparnajyothi-y commented on Feb 21, 2024

    @v-aparnajyothi-y
    Contributor

    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.

  6. fniephaus commented on Feb 21, 2024

    @fniephaus
    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?

  7. djthornton1212 commented on Feb 21, 2024

    @djthornton1212

    @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.

  8. fniephaus commented on Feb 28, 2024

    @fniephaus
    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.

  9. v-aparnajyothi-y commented on Mar 1, 2024

    @v-aparnajyothi-y
    Contributor

    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.

  10. v-aparnajyothi-y commented on Mar 15, 2024

    @v-aparnajyothi-y
    Contributor

    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.

  11. fniephaus commented on Mar 15, 2024

    @fniephaus
    Contributor

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

  12. v-aparnajyothi-y commented on Mar 28, 2024

    @v-aparnajyothi-y
    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

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions