-
Notifications
You must be signed in to change notification settings - Fork 648
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exposing trace record meta info in the task context (#5402)
This commit introduces the ability to access `task.previousTrace` and `task.previousException` that enable to access the trace runtime metrics and exception object of a previous failed task execution attempt. Signed-off-by: jorgee <[email protected]> Signed-off-by: Paolo Di Tommaso <[email protected]> Signed-off-by: Jorge Ejarque <[email protected]> Co-authored-by: Paolo Di Tommaso <[email protected]> Co-authored-by: Ben Sherman <[email protected]> Co-authored-by: Christopher Hakkaart <[email protected]>
- Loading branch information
1 parent
24d595c
commit ffdd381
Showing
7 changed files
with
84 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
set -e | ||
|
||
echo '' | ||
$NXF_RUN | tee stdout | ||
|
||
[[ `grep 'INFO' .nextflow.log | grep -c 'Submitted process > foo'` == 1 ]] || false | ||
[[ `grep 'INFO' .nextflow.log | grep -c 'Re-submitted process > foo'` == 3 ]] || false | ||
|
||
[[ `grep -c 'mem: 8 GB (previous: 4294967296) (error: nextflow.exception.ProcessFailedException: Process .* terminated with an error exit status (137))' stdout` == 1 ]] || false | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
process foo { | ||
memory { task.attempt > 1 ? task.previousTrace.memory * 2 : (1.GB) } | ||
errorStrategy 'retry' | ||
maxRetries 3 | ||
input: | ||
val i | ||
output: | ||
stdout | ||
script: | ||
if( task.attempt <= 3 ){ | ||
""" | ||
exit 137 | ||
""" | ||
} else { | ||
""" | ||
echo 'mem: $task.memory (previous: $task.previousTrace.memory) (error: $task.previousException)' | ||
exit 0 | ||
""" | ||
} | ||
} | ||
|
||
workflow { | ||
foo(channel.of(1)).view() | ||
} |