Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rush] Improve error reporting #4717

Merged
merged 1 commit into from
May 15, 2024

Conversation

dmichon-msft
Copy link
Contributor

Summary

Adds more information to Rush's error reporting in phased commands, and ensures that more error messages are included in the summary view.

Details

  • If a child operation process is killed via a signal (e.g. SIGTERM), and exits with a non-zero exit code, report the signal as well as the exit code. This comes up if, e.g., the process is killed by the OS due to lack of RAM.
  • If an afterExecuteOperation handler throws an error, ensure that any existing error from the original process is reported to the OperationExecutionRecord's Terminal instance and StdioSummarizer.
  • Ensure that the final error from an Operation is reported to the OperationExecutionRecord's Terminal instance and StdioSummarizer.

Unfortunately the error logging from pnpm-sync-lib still violates this contract, since it writes to the global terminal directly, but does so during afterExecuteOperation. See tiktok/pnpm-sync#31 and tiktok/pnpm-sync#32 for my suggested approach to address that case.

How it was tested

Ran build under debugger and induced the following failure states:

  • Killed a child process with SIGTERM and verified that the error message included that it failed due to being terminated with SIGTERM, and that the message appeared in the summary at the end of the build
  • Threw an error during beforeExecuteOperation and verified that the error message appeared in the summary at the end of the build
  • Threw an error during afterExecuteOperation and verified that the error message appeared in the summary at the end of the build

Impacted documentation

API documentation for StdioSummarizer

@iclanton iclanton merged commit 3a1a3e4 into microsoft:main May 15, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

None yet

3 participants