Skip to content

Commit 9eae5f5

Browse files
committed
feat: upload rc, stderr and stdout on failure
1 parent bd88152 commit 9eae5f5

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ The index `IX_METADATA_ENTRY_WEU_CFQN_JSI_JRA_MK` is added to `METADATA_ENTRY`.
2323

2424
This index supports planned metadata API enhancements that enable querying at granular scopes, namely calls, shards, and attempts.
2525

26+
### AWS Batch
27+
* Fixed an issue where job failures before all outputs were written would cause delocalization to fail, preventing the upload of return code, stdout, and stderr files needed for debugging.
28+
2629
## 91 Release Notes
2730

2831
#### Removal of Google LifeSciences backend code

supportedBackends/aws/src/main/scala/cromwell/backend/impl/aws/AwsBatchJob.scala

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,6 @@ final case class AwsBatchJob(
577577
replaced.patch(insertionPoint, preamble, 0) +
578578
s"""
579579
|{
580-
|set -e
581580
|# (re-)add tags to include added volumes:
582581
|if [[ "${doTagging}" == "true" ]]; then
583582
| echo "*** TAGGING RESOURCES ***"
@@ -588,15 +587,20 @@ final case class AwsBatchJob(
588587
|DELOCALIZATION_FAILED=0
589588
|$outputCopyCommand
590589
|echo "DELOCALIZATION RESULT: $$DELOCALIZATION_FAILED"
590+
|rc=$$(head -n 1 $workDir/${jobPaths.returnCodeFilename} 2>/dev/null) || rc=1
591591
|if [[ $$DELOCALIZATION_FAILED -eq 1 ]]; then
592592
| echo '*** DELOCALIZATION FAILED ***'
593-
| echo '*** EXITING WITH RETURN CODE 1***'
594-
| exit 1
593+
| if [[ "$$rc" -eq 0 ]]; then
594+
| echo '*** EXITING WITH RETURN CODE 1 ***'
595+
| exit 1
596+
| else
597+
| echo "*** EXITING WITH ORIGINAL RETURN CODE $$rc ***"
598+
| exit $$rc
599+
| fi
595600
|else
596601
| echo '*** COMPLETED DELOCALIZATION ***'
597602
|fi
598603
|echo '*** EXITING WITH RETURN CODE ***'
599-
|rc=$$(head -n 1 $workDir/${jobPaths.returnCodeFilename})
600604
|echo $$rc
601605
|exit $$rc
602606
|}

0 commit comments

Comments
 (0)