Skip to content

Commit 25bbb62

Browse files
jorgeepditommaso
andauthored
Fix possible deadlock in dynamic maxRetry resolution [ci fast] (#5474)
Signed-off-by: jorgee <[email protected]> Signed-off-by: Paolo Di Tommaso <[email protected]> Co-authored-by: Paolo Di Tommaso <[email protected]>
1 parent 6f52755 commit 25bbb62

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

modules/nextflow/src/main/groovy/nextflow/processor/TaskConfig.groovy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,7 @@ class TaskConfig extends LazyMap implements Cloneable {
345345

346346
int getMaxRetries() {
347347
def result = get('maxRetries')
348-
def defResult = getErrorStrategy() == ErrorStrategy.RETRY ? 1 : 0
349-
result ? result as int : defResult
348+
result ? result as int : 1
350349
}
351350

352351
int getMaxErrors() {

modules/nextflow/src/main/groovy/nextflow/script/ProcessConfig.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class ProcessConfig implements Map<String,Object>, Cloneable {
126126
debug: false,
127127
cacheable: true,
128128
shell: BashWrapperBuilder.BASH,
129-
maxRetries: 0,
129+
maxRetries: 1,
130130
maxErrors: -1,
131131
errorStrategy: ErrorStrategy.TERMINATE
132132
]

modules/nextflow/src/test/groovy/nextflow/processor/TaskConfigTest.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ class TaskConfigTest extends Specification {
157157

158158
where:
159159
value | expected
160-
null | 0
161-
0 | 0
160+
null | 1
161+
0 | 1
162162
1 | 1
163163
'3' | 3
164164
10 | 10
@@ -171,8 +171,8 @@ class TaskConfigTest extends Specification {
171171
when:
172172
config = new TaskConfig()
173173
then:
174-
config.maxRetries == 0
175-
config.getMaxRetries() == 0
174+
config.maxRetries == 1
175+
config.getMaxRetries() == 1
176176
config.getErrorStrategy() == ErrorStrategy.TERMINATE
177177

178178
when:

modules/nextflow/src/test/groovy/nextflow/script/ProcessConfigTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ProcessConfigTest extends Specification {
4747
expect:
4848
config.shell == ['/bin/bash','-ue']
4949
config.cacheable
50-
config.maxRetries == 0
50+
config.maxRetries == 1
5151
config.maxErrors == -1
5252
config.errorStrategy == ErrorStrategy.TERMINATE
5353
}

0 commit comments

Comments
 (0)