You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "stefankandic (via GitHub)" <gi...@apache.org> on 2024/05/21 16:06:58 UTC
[PR] [SPARK-48379] Cancel previous builds on a PR when new commit is pushed [spark]
stefankandic opened a new pull request, #46689:
URL: https://github.com/apache/spark/pull/46689
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
4. Be sure to keep the PR description updated to reflect all changes.
5. Please write your PR title to summarize what this PR proposes.
6. If possible, provide a concise example to reproduce the issue for a faster review.
7. If you want to add a new configuration, please read the guideline first for naming configurations in
'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
8. If you want to add or modify an error type or message, please read the guideline first in
'common/utils/src/main/resources/error/README.md'.
-->
### What changes were proposed in this pull request?
<!--
Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
2. If you fix some SQL features, you can provide some references of other DBMSes.
3. If there is design documentation, please add the link.
4. If there is a discussion in the mailing list, please add the link.
-->
When there is an open PR with a build in progress and a new commit is pushed I propose that we should cancel the previous build.
The exceptions are branches `master` and `branch-*` where we still want to be able to have multiple builds executing concurrently (if two PRs are merged to main at the same time we don't want to just run the build on the second one).
[Concurrecy docs](https://docs.github.com/en/actions/using-jobs/using-concurrency)
### Why are the changes needed?
<!--
Please clarify why the changes are needed. For instance,
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, you can clarify why it is a bug.
-->
To reduce wait times for newer commit's and save compute resources.
### Does this PR introduce _any_ user-facing change?
<!--
Note that it means *any* user-facing change including all aspects such as the documentation fix.
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
If no, write 'No'.
-->
No.
### How was this patch tested?
<!--
If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
-->
Manually.
### Was this patch authored or co-authored using generative AI tooling?
<!--
If generative AI tooling has been used in the process of authoring this patch, please include the
phrase: 'Generated-by: ' followed by the name of the tool and its version.
If no, write 'No'.
Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
-->
No.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-48379][INFRA] Cancel previous builds on a PR when new commit is pushed [spark]
Posted by "stefankandic (via GitHub)" <gi...@apache.org>.
stefankandic commented on PR #46689:
URL: https://github.com/apache/spark/pull/46689#issuecomment-2124334537
@yaooqinn Do you know what would be the workaround?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-48379][INFRA] Cancel previous builds on a PR when new commit is pushed [spark]
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #46689:
URL: https://github.com/apache/spark/pull/46689#discussion_r1609502261
##########
.github/workflows/build_main.yml:
##########
@@ -24,6 +24,10 @@ on:
branches:
- '**'
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: ${{ github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/heads/branch-') }}
Review Comment:
I think we should do this only in forked repository btw.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-48379][INFRA] Cancel previous builds on a PR when new commit is pushed [spark]
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on PR #46689:
URL: https://github.com/apache/spark/pull/46689#issuecomment-2124158148
We should also probably remove https://github.com/apache/spark/actions/workflows/cancel_duplicate_workflow_runs.yml and replace that to the approach used here (but of course should be done in a separate PR).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-48379][INFRA] Cancel previous builds on a PR when new commit is pushed [spark]
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon closed pull request #46689: [SPARK-48379][INFRA] Cancel previous builds on a PR when new commit is pushed
URL: https://github.com/apache/spark/pull/46689
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-48379][INFRA] Cancel previous builds on a PR when new commit is pushed [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on PR #46689:
URL: https://github.com/apache/spark/pull/46689#issuecomment-2124166565
I think the reason could be either due to cancellation or exceeding the per_page results, instead of a timeout.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-48379][INFRA] Cancel previous builds on a PR when new commit is pushed [spark]
Posted by "stefankandic (via GitHub)" <gi...@apache.org>.
stefankandic commented on PR #46689:
URL: https://github.com/apache/spark/pull/46689#issuecomment-2124112089
@HyukjinKwon Cancellation works fine, but the issue is that `Notify test workflow` is sometimes failing with `Failed to retrieve check_run_head after 3 attempts`.
Not sure, what is causing this, maybe we should wait a bit longer for a workflow to be started or something? Tried increasing the sleep time in the retry but it still seems to use the old value of 3 seconds:
<img width="545" alt="image" src="https://github.com/apache/spark/assets/154237371/d42ff63b-285b-4894-8024-bab752a1a921">
Do you have any ideas as to why this is happening as I see that you worked on this as well as @yaooqinn
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-48379][INFRA] Cancel previous builds on a PR when new commit is pushed [spark]
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on PR #46689:
URL: https://github.com/apache/spark/pull/46689#issuecomment-2124380074
I think this is fine.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-48379][INFRA] Cancel previous builds on a PR when new commit is pushed [spark]
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on PR #46689:
URL: https://github.com/apache/spark/pull/46689#issuecomment-2124340354
hmmmm
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-48379][INFRA] Cancel previous builds on a PR when new commit is pushed [spark]
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on PR #46689:
URL: https://github.com/apache/spark/pull/46689#issuecomment-2124390545
Merged to master.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-48379][INFRA] Cancel previous builds on a PR when new commit is pushed [spark]
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #46689:
URL: https://github.com/apache/spark/pull/46689#discussion_r1609779867
##########
.github/workflows/build_main.yml:
##########
@@ -24,6 +24,11 @@ on:
branches:
- '**'
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ # only cancel in forked repositories
+ cancel-in-progress: ${{ github.repository_owner != 'apache' }}
Review Comment:
Okay, there are two issues :-).
1. With `concurrency`, it introduces a new state like pending:

and the notify job fails at https://github.com/apache/spark/blob/master/.github/workflows/notify_test_workflow.yml#L122
So increasing the timeout here a lot would help.
2. The builds in the master branch in this main repo became sequential. It doesn't cancel and wait for the build in the previous commit to finish.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-48379][INFRA] Cancel previous builds on a PR when new commit is pushed [spark]
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #46689:
URL: https://github.com/apache/spark/pull/46689#discussion_r1609779867
##########
.github/workflows/build_main.yml:
##########
@@ -24,6 +24,11 @@ on:
branches:
- '**'
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ # only cancel in forked repositories
+ cancel-in-progress: ${{ github.repository_owner != 'apache' }}
Review Comment:
Okay, there are two issues :-).
1. With `concurrency`, it introduces a new state like pending:
![Uploading Screenshot 2024-05-22 at 8.17.03 PM.png…]()
and the notify job fails at https://github.com/apache/spark/blob/master/.github/workflows/notify_test_workflow.yml#L122
So increasing the timeout here a lot would help.
2. The builds in the master branch in this main repo became sequential. It doesn't cancel and wait for the build in the previous commit to finish.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-48379][INFRA] Cancel previous builds on a PR when new commit is pushed [spark]
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on PR #46689:
URL: https://github.com/apache/spark/pull/46689#issuecomment-2124558421
Let me revert it out for now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-48379][INFRA] Cancel previous builds on a PR when new commit is pushed [spark]
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #46689:
URL: https://github.com/apache/spark/pull/46689#discussion_r1609504098
##########
.github/workflows/build_main.yml:
##########
@@ -24,6 +24,10 @@ on:
branches:
- '**'
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: ${{ github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/heads/branch-') }}
Review Comment:
So we shouldn't cancel them if we're in apache spark repo.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-48379][INFRA] Cancel previous builds on a PR when new commit is pushed [spark]
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on PR #46689:
URL: https://github.com/apache/spark/pull/46689#issuecomment-2124155016
I retriggered, and seems working fine. I think it just failed because it tried to get the test run of the cancelled build.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-48379][INFRA] Cancel previous builds on a PR when new commit is pushed [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on PR #46689:
URL: https://github.com/apache/spark/pull/46689#issuecomment-2124399925
> @yaooqinn Do you know what would be the workaround?
The only suitable way seems to increase the await time for a new job to be scheduled
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org