-
Notifications
You must be signed in to change notification settings - Fork 13
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
Do not log JSON output pipe errors to rollbar. #3568
Conversation
The system is hanging up on us and there is nothing we can do about it.
ed3c071
to
91ae9f7
Compare
internal/output/json.go
Outdated
|
||
func isPipeClosedError(err error) bool { | ||
pipeErr := errors.Is(err, syscall.EPIPE) | ||
if runtime.GOOS == "windows" && errors.Is(err, syscall.Errno(242)) { |
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.
As long as the comment is correct which I think it is.
if runtime.GOOS == "windows" && errors.Is(err, syscall.Errno(242)) { | |
if runtime.GOOS == "windows" && errors.Is(err, syscall.Errno(232)) { |
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.
🤦 That was embarassing... Thanks
} | ||
|
||
func isPipeClosedError(err error) bool { | ||
pipeErr := errors.Is(err, syscall.EPIPE) |
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.
Should we also check for io.ErrClosedPipe
?
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.
I don't think so, because the error message is "io: read/write on closed pipe" (https://pkg.go.dev/io#pkg-variables). That's not consistent with the rollbar error message we are seeing. I feel like we want to be as narrow as possible right now for this ticket since we're turning off rollbar logging in this case. If we start seeing this, then we can revisit.
func isPipeClosedError(err error) bool { | ||
pipeErr := errors.Is(err, syscall.EPIPE) | ||
if runtime.GOOS == "windows" && errors.Is(err, syscall.Errno(242)) { | ||
// Note: 232 is Windows error code ERROR_NO_DATA, "The pipe is being closed". |
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.
Do we know if the Go library uses error code 109
as well? It is ERROR_BROKEN_PIPE
https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-
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.
I don't know. Regardless, that error message is "The pipe has been ended." As mentioned previously, I think we want to be as narrow as possible right now when turning off rollbar logging. I haven't seen that error message in rollbar yet.
The system is hanging up on us and there is nothing we can do about it.