nextflow icon indicating copy to clipboard operation
nextflow copied to clipboard

Introspection on errorStrategy alters its expected effect.

Open muniheart opened this issue 1 week ago • 0 comments

[ nextflow version 24.04.2.5914 ]

Consider the following workflow,

process foo {

    errorStrategy { task.exitStatus == 2 && task.attempt<3 ? 'retry' : 'terminate' }

    script:
    """
    exit 2
    """
}

process bar {

    errorStrategy { task.exitStatus == 2 && task.attempt<3 ? 'retry' : 'terminate' }

    script:
    log.info "$task.process: errorStrategy: $task.errorStrategy"
    """
    exit 2
    """
}

workflow {
    foo()
    bar()
}

Expected behavior and actual behavior

Each of the processes foo and bar should be run twice, but that is not what I observe. It seems that introspection of task.errorStrategy in process bar is somehow altering the expected behavoir, which is that exhibited by process foo.

Steps to reproduce the problem

nextflow run .

Program output

N E X T F L O W ~ version 24.04.2

Launching ./main.nf [deadly_bhaskara] DSL2 - revision: 4c53b20621

executor > local (3) executor > local (3) [2c/02581e] foo [100%] 2 of 2, failed: 2, retries: 1 ✘ [d5/70a303] bar [100%] 1 of 1, failed: 1 ✘ bar: errorStrategy: TERMINATE [94/aba435] NOTE: Process foo terminated with an error exit status (2) -- Execution is retried (1) ERROR ~ Error executing process > 'bar'

Caused by: Process bar terminated with an error exit status (2)

Command executed:

exit 2

Command exit status: 2

Command output: (empty)

Environment

  • Nextflow version: [24.04.2.5914]
  • Java version: [17.0.6]
  • Operating system: [Gentoo Linux 2.14]
  • Bash version: (GNU bash, version 5.1.8(1)-release (x86_64-redhat-linux-gnu))

nextflow.log

Additional context

(Add any other context about the problem here)

muniheart avatar Jun 27 '24 21:06 muniheart