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

rpcclient: provide some exported error for disconnected WSClient #3000

Merged
merged 1 commit into from
May 3, 2023

Conversation

roman-khimov
Copy link
Member

Regular Client doesn't care much about connections, because HTTP client's Do method can reuse old ones or create additional ones on the fly. So one request can fail and the next one easily succeed. WSClient is different, it works via a single connection and if it breaks, it breaks forever for this client. Callers will get some error on every request afterwards and it'd be nice for this error to be the same so that API users could detect disconnection this way too.

Related to nspcc-dev/neofs-node#2325.

Regular Client doesn't care much about connections, because HTTP client's Do
method can reuse old ones or create additional ones on the fly. So one request
can fail and the next one easily succeed. WSClient is different, it works via
a single connection and if it breaks, it breaks forever for this
client. Callers will get some error on every request afterwards and it'd be
nice for this error to be the same so that API users could detect
disconnection this way too.

Related to nspcc-dev/neofs-node#2325.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
@roman-khimov roman-khimov added rpc RPC server and client enhancement Improving existing functionality labels May 3, 2023
@roman-khimov roman-khimov added this to the v0.102.0 milestone May 3, 2023
@codecov
Copy link

codecov bot commented May 3, 2023

Codecov Report

Merging #3000 (fcaa24f) into master (8bd9a7d) will not change coverage.
The diff coverage is 50.00%.

@@           Coverage Diff           @@
##           master    #3000   +/-   ##
=======================================
  Coverage   84.63%   84.63%           
=======================================
  Files         328      328           
  Lines       43164    43164           
=======================================
  Hits        36531    36531           
+ Misses       5144     5143    -1     
- Partials     1489     1490    +1     
Impacted Files Coverage Δ
pkg/rpcclient/wsclient.go 75.08% <50.00%> (-0.33%) ⬇️

... and 4 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@roman-khimov roman-khimov merged commit 8e6025f into master May 3, 2023
15 of 18 checks passed
@roman-khimov roman-khimov deleted the conloss-error-for-wsclient branch May 3, 2023 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving existing functionality rpc RPC server and client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants