rpcclient: Fix ws-reader hang on sending a response #1

Merged
fyrchik merged 1 commit from aarifullin/neoneo-go:fix/wsreader_hang into support/v0.106-mtls 2024-07-26 10:59:10 +00:00
Member
  • wsReader may get blocked on sending to the response channel if receiver can't read the response out.
  • If wsWriter goroutine got an error or wsClient is going to get shut down, then wsReader should stop trying to send the response as it's not reasonable and this leads only to blocking.
* `wsReader` may get blocked on sending to the response channel if receiver can't read the response out. * If `wsWriter` goroutine got an error or `wsClient` is going to get shut down, then `wsReader` should stop trying to send the response as it's not reasonable and this leads only to blocking.
aarifullin added 1 commit 2024-07-26 08:23:57 +00:00
* `wsReader` may get blocked on sending to the response channel if
  receiver can't read the response out.
* If `wsWriter` goroutine got an error or `wsClient` is going to get shut down,
  then `wsReader` should stop trying to send the response as it's not reasonable
  and this leads only to blocking.

Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
aarifullin force-pushed fix/wsreader_hang from 10c8492276 to 25eb7f9bd5 2024-07-26 08:24:25 +00:00 Compare
aarifullin requested review from fyrchik 2024-07-26 08:24:29 +00:00
fyrchik reviewed 2024-07-26 09:19:44 +00:00
@ -605,0 +606,4 @@
connCloseErr = fmt.Errorf("response won't be sent to channel %d: ws-writer is done", id)
break readloop
case <-c.shutdown:
connCloseErr = fmt.Errorf("response won't be sent to channel %d: shutting down", id)
Owner

This will overwrite the previous connection error.
I think if any of this is done, the connection error already exists and is descriptive.

This will overwrite the previous connection error. I think if any of this is done, the connection error already exists and is descriptive.
Author
Member

Removed

Removed
aarifullin force-pushed fix/wsreader_hang from 25eb7f9bd5 to 5481339d69 2024-07-26 09:36:40 +00:00 Compare
fyrchik approved these changes 2024-07-26 10:59:02 +00:00
fyrchik merged commit 5481339d69 into support/v0.106-mtls 2024-07-26 10:59:10 +00:00
Sign in to join this conversation.
No description provided.