dice icon indicating copy to clipboard operation
dice copied to clipboard

Issue-1103 - Fixing broken pipe errors

Open Kannav02 opened this issue 4 months ago • 6 comments

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!

Kannav02 avatar Oct 20 '24 23:10 Kannav02