Skip to content

Commit

Permalink
Fix Google Batch autoRetryExitCodes bug (#5828)
Browse files Browse the repository at this point in the history
Signed-off-by: jorgee <jorge.ejarque@seqera.io>
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
Co-authored-by: Ben Sherman <bentshermann@gmail.com>
  • Loading branch information
jorgee and bentsherman authored Feb 28, 2025
1 parent cfb27d0 commit cfeedd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class GoogleBatchTaskHandler extends TaskHandler implements FusionAwareTask {
LifecyclePolicy.newBuilder()
.setActionCondition(
LifecyclePolicy.ActionCondition.newBuilder()
.addExitCodes(50001)
.addAllExitCodes(executor.config.autoRetryExitCodes)
)
.setAction(LifecyclePolicy.Action.RETRY_TASK)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ class GoogleBatchTaskHandlerTest extends Specification {
getBootDiskImage() >> BOOT_IMAGE
getCpuPlatform() >> CPU_PLATFORM
getMaxSpotAttempts() >> 5
getAutoRetryExitCodes() >> [50001,50002]
getSpot() >> true
getNetwork() >> 'net-1'
getServiceAccountEmail() >> 'foo@bar.baz'
Expand Down Expand Up @@ -198,7 +199,9 @@ class GoogleBatchTaskHandlerTest extends Specification {
taskSpec.getMaxRunDuration().getSeconds() == TIMEOUT.seconds
taskSpec.getVolumes(0).getMountPath() == '/tmp'
taskSpec.getMaxRetryCount() == 5
taskSpec.getLifecyclePolicies(0).getActionCondition().getExitCodesCount() == 2
taskSpec.getLifecyclePolicies(0).getActionCondition().getExitCodes(0) == 50001
taskSpec.getLifecyclePolicies(0).getActionCondition().getExitCodes(1) == 50002
taskSpec.getLifecyclePolicies(0).getAction().toString() == 'RETRY_TASK'
and:
runnable.getContainer().getCommandsList().join(' ') == '/bin/bash -o pipefail -c bash .command.run'
Expand Down

0 comments on commit cfeedd6

Please sign in to comment.