Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b9fd39c

Browse files
authored
Fix Dataproc cleanup race condition (#30154)
1 parent 5a9a27c commit b9fd39c

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979
github.event_name == 'push' ||
8080
github.event_name == 'pull_request_target' ||
8181
(github.event_name == 'schedule' && github.repository == 'apache/beam') ||
82+
github.event_name == 'workflow_dispatch' ||
8283
startsWith(github.event.comment.body, 'Run Job With Matrix')
8384
steps:
8485
- uses: actions/checkout@v3

.github/workflows/beam_CleanUpDataprocResources.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ name: Cleanup Dataproc Resources
1717

1818
on:
1919
schedule:
20-
- cron: '0 */6 * * *'
20+
- cron: '0 0 * * *'
2121
workflow_dispatch:
2222

2323
#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event

.test-infra/dataproc/cleanup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ function filterClusters(){
4444

4545
elapsedHours=$((($currentDate - $clusterStartTime)/3600))
4646

47-
#Most of the jobs commonly finish in less than one hour
48-
if [[ $elapsedHours -ge 2 ]]; then
47+
# teardown clusters >= 6 hr old
48+
if [[ $elapsedHours -ge 6 ]]; then
4949
for name in ${generatedResources[@]}; do
5050
# Only resources generated by the groovy jobs set are queued for deletion
5151
if [[ "$cluster" == *${name}* && ! ("$cluster" =~ nokill) ]]; then

0 commit comments

Comments
 (0)