Skip to content

Commit

Permalink
Don't set dataset peek for errored jobs
Browse files Browse the repository at this point in the history
This is consistent with the extended metadata logic, and prevents:
```
Message
Job wrapper finish method failed
Stack Trace

Newest

IndexError
list index out of range
```
which only makes it harder to diagnose the actual error, which in the
case of https://sentry.galaxyproject.org/share/issue/831261683ce642a4976efa20a9a0e55c/
is `\nslurmstepd: error: *** JOB 1910486 ON js2-gpu-small0 CANCELLED AT 2024-05-26T23:30:00 DUE TO TIME LIMIT ***\n`
  • Loading branch information
mvdbeek committed May 27, 2024
1 parent d8b827f commit 11ae179
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/galaxy/jobs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1786,13 +1786,14 @@ def _finish_dataset(self, output_name, dataset, job, context, final_job_state, r
working_directory=self.working_directory,
remote_metadata_directory=remote_metadata_directory,
)
line_count = context.get("line_count", None)
try:
# Certain datatype's set_peek methods contain a line_count argument
dataset.set_peek(line_count=line_count)
except TypeError:
# ... and others don't
dataset.set_peek()
if final_job_state != job.states.ERROR:
line_count = context.get("line_count", None)
try:
# Certain datatype's set_peek methods contain a line_count argument
dataset.set_peek(line_count=line_count)
except TypeError:
# ... and others don't
dataset.set_peek()
else:
# Handle purged datasets.
dataset.blurb = "empty"
Expand Down

0 comments on commit 11ae179

Please sign in to comment.