Skip to content

Show standard error for failing CWL jobs that capture standard error#5555

Open
adamnovak wants to merge 6 commits into
masterfrom
issues/2994-show-standard-error
Open

Show standard error for failing CWL jobs that capture standard error#5555
adamnovak wants to merge 6 commits into
masterfrom
issues/2994-show-standard-error

Conversation

@adamnovak

Copy link
Copy Markdown
Member

This fixes #2994 by logging standard error from CWL tasks to the Toil log, when the tasks fail, even if standard error for the task is being captured to a file.

(When standard error is not captured, we already log it to the Toil log.)

The result looks just like if it wasn't being captured:

[2026-07-16T17:15:05-0400] [Thread-4 (statsAndLoggingAggregator)] [I] [toil.statsAndLogging] fail_with_log.cwl.hello._:640ebd69-f2a0-4ed6-a923-4b450915dd90.stderr follows:
=========>
	Message: This is a test
<=========

We don't do this when the job succeeds, because the user might be capturing the log because it's inconveniently large.

Changelog Entry

To be copied to the draft changelog by merger:

  • CWL job error logs are now reported for failing jobs even if the job's standard error is captured to a file.

Reviewer Checklist

  • Make sure it is coming from issues/XXXX-fix-the-thing in the Toil repo, or from an external repo.
    • If it is coming from an external repo, make sure to pull it in for CI with:
      contrib/admin/test-pr otheruser theirbranchname issues/XXXX-fix-the-thing
      
    • If there is no associated issue, create one.
  • Read through the code changes. Make sure that it doesn't have:
    • Addition of trailing whitespace.
    • New variable or member names in camelCase that want to be in snake_case.
    • New functions without type hints.
    • New functions or classes without informative docstrings.
    • Changes to semantics not reflected in the relevant docstrings.
    • New or changed command line options for Toil workflows that are not reflected in docs/running/{cliOptions,cwl,wdl}.rst
    • New features without tests.
  • Comment on the lines of code where problems exist with a review comment. You can shift-click the line numbers in the diff to select multiple lines.
  • Finish the review with an overall description of your opinion.

Merger Checklist

  • Make sure the PR passed tests, including the Gitlab tests, for the most recent commit in its branch.
  • Make sure the PR has been reviewed. If not, review it. If it has been reviewed and any requested changes seem to have been addressed, proceed.
  • Merge with the Github "Squash and merge" feature.
    • If there are multiple authors' commits, add Co-authored-by to give credit to all contributing authors.
  • Copy its recommended changelog entry to the Draft Changelog.
  • Append the issue number in parentheses to the changelog entry.

@mr-c mr-c left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Epic PR, nice re-org!

Comment thread src/toil/cwl/cwltoil.py
# This section deals with the CWL promise system.
#
# This is not to be confused with the Toil promise system, except under
# fconfusing circumstances.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# fconfusing circumstances.
# confusing circumstances.

Comment thread src/toil/cwl/cwltoil.py
# Processes in general can generate a lot of types of jobs, but CommandLineTools and ExpressionTools are typed as generating a more restricted set of possible types of jobs.
# We want to be able to wrap them with the same wrapper.
#
# ExperssionTool's job() is also able to take a None for output_callbacks, while CommandLineTool's can't.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# ExperssionTool's job() is also able to take a None for output_callbacks, while CommandLineTool's can't.
# ExpressionTool's job() is also able to take a None for output_callbacks, while CommandLineTool's can't.

Comment thread src/toil/cwl/cwltoil.py
#
# We can't just say the wrapper mixin generates the more permissive type range because then it won't be substitutable for a CommandLineTool, etc.
#
# So to type this we have to do a bunch of ugly type stuff, and event hen we need to cast (see https://github.com/python/mypy/issues/17192#issuecomment-4995017670)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# So to type this we have to do a bunch of ugly type stuff, and event hen we need to cast (see https://github.com/python/mypy/issues/17192#issuecomment-4995017670)
# So to type this we have to do a bunch of ugly type stuff, and even then we need to cast (see https://github.com/python/mypy/issues/17192#issuecomment-4995017670)

Comment thread src/toil/cwl/cwltoil.py
stage_listing: bool = False,
streaming_allowed: bool = True,
):
Ypu also need to tell it the types that the mixed-with Process uses on its

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Ypu also need to tell it the types that the mixed-with Process uses on its
You also need to tell it the types that the mixed-with Process uses on its

Comment thread src/toil/cwl/cwltoil.py
Attach the Toil tool to the Toil file store it is running against.

This is needed in order to allow hooks we add into the cwltool
tool-running code to talk to the file stroe for things like logging.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tool-running code to talk to the file stroe for things like logging.
tool-running code to talk to the file store for things like logging.

Comment thread src/toil/cwl/cwltoil.py

#####
#
# In this section, we have helper functions for loading and setting uop a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# In this section, we have helper functions for loading and setting uop a
# In this section, we have helper functions for loading and setting up a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

error log file not visible with stderr redirection

2 participants