-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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 handle network error in SetCloseHandler()
#863
Conversation
For more detail, we have an unit test as https://github.com/knative/serving/blob/65ce2aece44a5bc5550b54aef657a82f0a6ce61b/pkg/autoscaler/statserver/server_test.go#L111 but it stops getting |
This may have been fixed in #865 can you take a look and verify? |
No, #865 does not fix the issue. I looked at and also verified it. |
Then there is a merge conflict with this pull request now that needs to be resolved then. |
With this change and 865, the close handler will in effect ignore all errors. Consider changing the code to ignore all errors as as the code did prior to August of this year. It's more important to return the CloseError to the application than any error returned from writing the control message. |
I think the close handler with this PR will not ignore all errors but will return some error such as
I sort of agree that the close handle should ignore all errors. But I cannot confirm that so this PR ignores network error only for now. |
The websocket connection ignored the error returned from echoing the close message until the PR in August. It seems safe to revert back to the original code. |
Okay, thank you. Updated |
@coreydaley Could you please take a look? |
@coreydaley gentle ping. |
There was a recent issue brought up about noisy, unactionable error messages that may be related here: #878 I'm in favor of taking a similar approach and ignoring the error in this specific case. @coreydaley thoughts? |
@coreydaley @AlexVulaj Sorry for bothering you. But could you please take a look? |
@coreydaley @AlexVulaj gentle ping. |
Hey folks - what's the latest with this PR? Knative is hoping to bump to 1.5.1+ but this is blocking us |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #863 +/- ##
==========================================
+ Coverage 70.52% 71.21% +0.69%
==========================================
Files 11 11
Lines 1591 1584 -7
==========================================
+ Hits 1122 1128 +6
+ Misses 358 349 -9
+ Partials 111 107 -4 ☔ View full report in Codecov by Sentry. |
As gorilla/websocket#863 was merged, we can bump the gorilla websocket to the latest version. Fix knative#14597
This MR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/gorilla/websocket](https://github.com/gorilla/websocket) | require | patch | `v1.5.1` -> `v1.5.3` | --- ### Release Notes <details> <summary>gorilla/websocket (github.com/gorilla/websocket)</summary> ### [`v1.5.3`](https://github.com/gorilla/websocket/releases/tag/v1.5.3) [Compare Source](gorilla/websocket@v1.5.2...v1.5.3) #### Important change This reverts the websockets package back to gorilla/websocket@931041c #### What's Changed - Fixes subprotocol selection (aling with rfc6455) by [@​KSDaemon](https://github.com/KSDaemon) in gorilla/websocket#823 - Update README.md, replace master to main by [@​mstmdev](https://github.com/mstmdev) in gorilla/websocket#862 - Use status code constant by [@​mstmdev](https://github.com/mstmdev) in gorilla/websocket#864 - conn.go: default close handler should not return ErrCloseSent. by [@​pnx](https://github.com/pnx) in gorilla/websocket#865 - fix: replace ioutil.readfile with os.readfile by [@​rfyiamcool](https://github.com/rfyiamcool) in gorilla/websocket#868 - fix: add comment for the readBufferSize and writeBufferSize by [@​rfyiamcool](https://github.com/rfyiamcool) in gorilla/websocket#869 - Remove noisy printf in NextReader() and beginMessage() by [@​bcreane](https://github.com/bcreane) in gorilla/websocket#878 - docs(echoreadall): fix function echoReadAll comment by [@​XdpCs](https://github.com/XdpCs) in gorilla/websocket#881 - make tests parallel by [@​ninedraft](https://github.com/ninedraft) in gorilla/websocket#872 - Upgrader.Upgrade: use http.ResposnseController by [@​ninedraft](https://github.com/ninedraft) in gorilla/websocket#871 - Do not handle network error in `SetCloseHandler()` by [@​nak3](https://github.com/nak3) in gorilla/websocket#863 - perf: reduce timer in write_control by [@​rfyiamcool](https://github.com/rfyiamcool) in gorilla/websocket#879 - fix: lint example code by [@​rfyiamcool](https://github.com/rfyiamcool) in gorilla/websocket#890 - feat: format message type by [@​rfyiamcool](https://github.com/rfyiamcool) in gorilla/websocket#889 - Remove hideTempErr to allow downstream users to check for errors like net.ErrClosed by [@​UnAfraid](https://github.com/UnAfraid) in gorilla/websocket#894 - Do not timeout when WriteControl deadline is zero in gorilla/websocket#898 - Excludes errchecks linter by [@​apoorvajagtap](https://github.com/apoorvajagtap) in gorilla/websocket#904 - Return errors instead of printing to logs by [@​apoorvajagtap](https://github.com/apoorvajagtap) in gorilla/websocket#897 - Revert " Update go version & add verification/testing tools ([#​840](gorilla/websocket#840))" by [@​apoorvajagtap](https://github.com/apoorvajagtap) in gorilla/websocket#908 - Fixes broken random value generation by [@​apoorvajagtap](https://github.com/apoorvajagtap) in gorilla/websocket#926 - Reverts back to v1.5.0 by [@​apoorvajagtap](https://github.com/apoorvajagtap) in gorilla/websocket#929 #### New Contributors - [@​KSDaemon](https://github.com/KSDaemon) made their first contribution in gorilla/websocket#823 - [@​mstmdev](https://github.com/mstmdev) made their first contribution in gorilla/websocket#862 - [@​pnx](https://github.com/pnx) made their first contribution in gorilla/websocket#865 - [@​rfyiamcool](https://github.com/rfyiamcool) made their first contribution in gorilla/websocket#868 - [@​bcreane](https://github.com/bcreane) made their first contribution in gorilla/websocket#878 - [@​XdpCs](https://github.com/XdpCs) made their first contribution in gorilla/websocket#881 - [@​ninedraft](https://github.com/ninedraft) made their first contribution in gorilla/websocket#872 - [@​nak3](https://github.com/nak3) made their first contribution in gorilla/websocket#863 - [@​UnAfraid](https://github.com/UnAfraid) made their first contribution in gorilla/websocket#894 - [@​apoorvajagtap](https://github.com/apoorvajagtap) made their first contribution in gorilla/websocket#904 **Full Changelog**: gorilla/websocket@v1.5.1...v1.5.3 ### [`v1.5.2`](https://github.com/gorilla/websocket/releases/tag/v1.5.2) [Compare Source](gorilla/websocket@v1.5.1...v1.5.2) #### What's Changed - Fixes subprotocol selection (aling with rfc6455) by [@​KSDaemon](https://github.com/KSDaemon) in gorilla/websocket#823 - Update README.md, replace master to main by [@​mstmdev](https://github.com/mstmdev) in gorilla/websocket#862 - Use status code constant by [@​mstmdev](https://github.com/mstmdev) in gorilla/websocket#864 - conn.go: default close handler should not return ErrCloseSent. by [@​pnx](https://github.com/pnx) in gorilla/websocket#865 - fix: replace ioutil.readfile with os.readfile by [@​rfyiamcool](https://github.com/rfyiamcool) in gorilla/websocket#868 - fix: add comment for the readBufferSize and writeBufferSize by [@​rfyiamcool](https://github.com/rfyiamcool) in gorilla/websocket#869 - Remove noisy printf in NextReader() and beginMessage() by [@​bcreane](https://github.com/bcreane) in gorilla/websocket#878 - docs(echoreadall): fix function echoReadAll comment by [@​XdpCs](https://github.com/XdpCs) in gorilla/websocket#881 - make tests parallel by [@​ninedraft](https://github.com/ninedraft) in gorilla/websocket#872 - Upgrader.Upgrade: use http.ResposnseController by [@​ninedraft](https://github.com/ninedraft) in gorilla/websocket#871 - Do not handle network error in `SetCloseHandler()` by [@​nak3](https://github.com/nak3) in gorilla/websocket#863 - perf: reduce timer in write_control by [@​rfyiamcool](https://github.com/rfyiamcool) in gorilla/websocket#879 - fix: lint example code by [@​rfyiamcool](https://github.com/rfyiamcool) in gorilla/websocket#890 - feat: format message type by [@​rfyiamcool](https://github.com/rfyiamcool) in gorilla/websocket#889 - Remove hideTempErr to allow downstream users to check for errors like net.ErrClosed by [@​UnAfraid](https://github.com/UnAfraid) in gorilla/websocket#894 - Do not timeout when WriteControl deadline is zero in gorilla/websocket#898 - Excludes errchecks linter by [@​apoorvajagtap](https://github.com/apoorvajagtap) in gorilla/websocket#904 - Return errors instead of printing to logs by [@​apoorvajagtap](https://github.com/apoorvajagtap) in gorilla/websocket#897 - Revert " Update go version & add verification/testing tools ([#​840](gorilla/websocket#840))" by [@​apoorvajagtap](https://github.com/apoorvajagtap) in gorilla/websocket#908 - Fixes broken random value generation by [@​apoorvajagtap](https://github.com/apoorvajagtap) in gorilla/websocket#926 #### New Contributors - [@​KSDaemon](https://github.com/KSDaemon) made their first contribution in gorilla/websocket#823 - [@​mstmdev](https://github.com/mstmdev) made their first contribution in gorilla/websocket#862 - [@​pnx](https://github.com/pnx) made their first contribution in gorilla/websocket#865 - [@​rfyiamcool](https://github.com/rfyiamcool) made their first contribution in gorilla/websocket#868 - [@​bcreane](https://github.com/bcreane) made their first contribution in gorilla/websocket#878 - [@​XdpCs](https://github.com/XdpCs) made their first contribution in gorilla/websocket#881 - [@​ninedraft](https://github.com/ninedraft) made their first contribution in gorilla/websocket#872 - [@​nak3](https://github.com/nak3) made their first contribution in gorilla/websocket#863 - [@​UnAfraid](https://github.com/UnAfraid) made their first contribution in gorilla/websocket#894 - [@​apoorvajagtap](https://github.com/apoorvajagtap) made their first contribution in gorilla/websocket#904 **Full Changelog**: gorilla/websocket@v1.5.1...v1.5.2 </details> --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yODYuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQxOS4xIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=--> See merge request alpine/infra/build-server-status!14
The 666c197 added an error handling in
SetCloseHandler()
and peer stops gettingCloseError
when network issue likewrite: broken pipe
happens because the close handle returns the error.Hence this patch changes to skip network error handling.