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

Do not log JSON output pipe errors to rollbar. #3568

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

mitchell-as
Copy link
Contributor

@mitchell-as mitchell-as commented Oct 29, 2024

BugDX-3135 Rollbar: projects [-o]: Could not write json output, error: 'write /dev/stdout: The pipe is being closed.': The pipe is being closed.

The system is hanging up on us and there is nothing we can do about it.

@github-actions github-actions bot changed the base branch from master to version/0-48-0-RC1 October 29, 2024 18:09
The system is hanging up on us and there is nothing we can do about it.
@mitchell-as mitchell-as requested a review from MDrakos October 29, 2024 20:06
@mitchell-as mitchell-as marked this pull request as ready for review October 29, 2024 20:06

func isPipeClosedError(err error) bool {
pipeErr := errors.Is(err, syscall.EPIPE)
if runtime.GOOS == "windows" && errors.Is(err, syscall.Errno(242)) {
Copy link
Member

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.

Suggested change
if runtime.GOOS == "windows" && errors.Is(err, syscall.Errno(242)) {
if runtime.GOOS == "windows" && errors.Is(err, syscall.Errno(232)) {

Copy link
Contributor Author

@mitchell-as mitchell-as Oct 30, 2024

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)
Copy link
Member

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?

Copy link
Contributor Author

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".
Copy link
Member

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-

Copy link
Contributor Author

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.

@mitchell-as mitchell-as requested a review from MDrakos October 30, 2024 14:01
@mitchell-as mitchell-as merged commit 682a245 into version/0-48-0-RC1 Oct 31, 2024
8 checks passed
@mitchell-as mitchell-as deleted the mitchell/dx-3135 branch October 31, 2024 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants