-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Add more information to job process failure error #7251
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
Conversation
catch (Exception exception) | ||
{ | ||
exitCode = -1; | ||
exitMessage = StringUtil.Format("<Unable to read streams from job process for reason '{0}'>", exception.Message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error message string should also go into the resx file for eventual localization.
{ | ||
var jobProcess = (Process)sender; | ||
exitCode = jobProcess.ExitCode; | ||
exitMessage = exitCode == 0 ? jobProcess.StandardOutput.ReadToEnd() : jobProcess.StandardError.ReadToEnd(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible for both stdout and stderror to have information on exit? We may want to read both, but I think this is fine for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I was thinking the same - wasn't sure what the policy is on cramming too much information into a single error message
@@ -1657,4 +1657,10 @@ All WinRM sessions connected to PowerShell session configurations, such as Micro | |||
<data name="WSManClientDllNotAvailable" xml:space="preserve"> | |||
<value>This parameter set requires WSMan, and no supported WSMan client library was found. WSMan is either not installed or unavailable for this system.</value> | |||
</data> | |||
<data name="ProcessExitInfo" xml:space="preserve"> | |||
<value>Exit code {0}, stdout '{1}', stderr '{2}'.</value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe split on three line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that would be nicer. Is that "allowed" in error messages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have multiline error messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Reopen the PR to restart CIs. |
PR Summary
Adds more information to the exception thrown when the process running a job exits unexpectedly. This is part of an attempt to work out why a particular
Stop-Job
test is failing in CI. See #7249.We can change the particular implementation and error message as needed. Even if we decide not to merge it, opening the PR may still help us to diagnose the problem.
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
to the beginning of the title and remove the prefix when the PR is ready.[feature]
if the change is significant or affects feature tests