Description
Description:
When switching from setup-java v3 to v4 the post run part is significantly slower.
Task version:
v4
Platform:
- Ubuntu
- macOS
- Windows
Runner type:
- Hosted
- Self-hosted
Repro steps:
Slow:
jobs:
verify:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: 'maven'
- name: run maven
run: |
mvn -B --settings .mvn/settings.xml verify
shell: bash
Fast:
jobs:
verify:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'maven'
- name: run maven
run: |
mvn -B --settings .mvn/settings.xml verify
shell: bash
Expected behavior:
v4 should have the same speed as v3.
Both executions had no cache hits and the amount of data was approx 30MB.
Actual behavior:
v4 is in this case orders of magnitude slower than v3.
Additional information:
I have seen that actions setup-node actions/setup-node#878
and setup-ruby ruby/setup-ruby#543 have had the same problem.
It seems that it had to do with the upgrade of the actions/cache version.
I think their solution was to exit the process manually after caching is complete as otherwise the job simply hangs until some timeout.
After looking at this repo for a very short time my guess is that perhaps somewhere
here ->
Line 150 in 9704b39
a
process.exit(0)
could solve the problem (as I said, I'm only guessing based on the node and ruby solutions).