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

Issue-1103 - Fixing broken pipe errors #1170

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Kannav02
Copy link
Contributor

The identification of broken pipe is only when there is an abrupt exit, so what I saw in the codebase was there are only a couple of places that deal with the closure of WebSocket connections, most of them were only handling the case where the user exited irrespective if it was gracefully or abruptly, so I modified and added some sections for the same

  • in the closing_handshake , it wasn't checking if the closeValue had an error, indicating that there was an error while closing the connection, so I added a check for the same
  • now when a message is being read, if there is an error that belongs to the errs category, it means that there is a graceful exit, otherwise, the exit was due to another error, so I have added the check for the same
  • In the WriteResponseWithRetries you have a case where the function returns the syscall.EPIPE error, this function is utilized in WebSocketHandler function, so I have added the check for the same

Those were all the that i found were capable of returning broken pipe errors, i have provided the segregated messages for the same, please do let me know if any other changes or features are needed

Fixes #1103

Thank you!

@JyotinderSingh
Copy link
Collaborator

Thanks for this contribution, please fix the lint errors and merge conflicts

@Kannav02
Copy link
Contributor Author

Hey @JyotinderSingh!

Sure, i would resolve the merge conflicts, however I believe the linting errors existed even before I tried to make any change as they are in files different to the one I had made changes to, I don't want to break the codebase

    - imports changed
    - outdented the code from the else block due to break statement in
      if block
    - removed extra blank line for consistent formatting
@Kannav02
Copy link
Contributor Author

Hey @JyotinderSingh!

I think the code should be good for review now , thank you for the help

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.

Investigate and fix "broken pipe" errors
2 participants