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

rpc/jsonrpc/server: return an error in WriteRPCResponseHTTP(Error) #6204

Merged
merged 4 commits into from
Mar 10, 2021

Conversation

melekes
Copy link
Contributor

@melekes melekes commented Mar 4, 2021

instead of panicking
Closes #5529

@melekes melekes requested a review from tac0turtle as a code owner March 4, 2021 06:23
@melekes melekes self-assigned this Mar 4, 2021
@melekes melekes added the S:backport-to-v0.34.x Tell mergify to backport the PR to v0.34.x label Mar 4, 2021
@codecov
Copy link

codecov bot commented Mar 4, 2021

Codecov Report

Merging #6204 (2eb90e6) into master (884d4d5) will increase coverage by 0.06%.
The diff coverage is 14.63%.

@@            Coverage Diff             @@
##           master    #6204      +/-   ##
==========================================
+ Coverage   60.72%   60.79%   +0.06%     
==========================================
  Files         276      276              
  Lines       25788    25788              
==========================================
+ Hits        15659    15677      +18     
+ Misses       8508     8487      -21     
- Partials     1621     1624       +3     
Impacted Files Coverage Δ
rpc/jsonrpc/server/http_uri_handler.go 32.47% <0.00%> (-2.07%) ⬇️
rpc/jsonrpc/server/http_json_handler.go 59.84% <11.11%> (-2.66%) ⬇️
rpc/jsonrpc/server/http_server.go 63.39% <38.46%> (+5.13%) ⬆️
mempool/reactor.go 65.71% <0.00%> (-5.00%) ⬇️
statesync/snapshots.go 91.59% <0.00%> (-1.69%) ⬇️
mempool/clist_mempool.go 80.42% <0.00%> (-0.72%) ⬇️
consensus/state.go 66.38% <0.00%> (-0.19%) ⬇️
p2p/router.go 78.28% <0.00%> (+0.61%) ⬆️
statesync/syncer.go 80.40% <0.00%> (+0.80%) ⬆️
consensus/reactor.go 68.80% <0.00%> (+0.94%) ⬆️
... and 3 more

Copy link
Contributor

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

rpc/jsonrpc/server/http_server.go Outdated Show resolved Hide resolved
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
@michaelfig
Copy link
Contributor

michaelfig commented Mar 9, 2021

Am I correct in thinking this will fix my validator going MIA for a brief period (a block or two) with repeating Panic during RPC panic recovery? Here is the log excerpt https://gist.github.com/michaelfig/40810a67c68c6991a070c7b06f29712b

Please LMK if that's encompassed in this PR or if I should file a new issue. Thanks!

Never mind: I saw that #6078 and #5529 together described my situation, and the current PR looks like it solves it completely.

@michaelfig michaelfig mentioned this pull request Mar 9, 2021
8 tasks
@melekes melekes merged commit 00b9524 into master Mar 10, 2021
@melekes melekes deleted the anton/5529-rpc-panics branch March 10, 2021 05:29
mergify bot pushed a commit that referenced this pull request Mar 10, 2021
…6204)

instead of panicking
Closes #5529

(cherry picked from commit 00b9524)

# Conflicts:
#	CHANGELOG_PENDING.md
#	rpc/jsonrpc/server/http_json_handler.go
#	rpc/jsonrpc/server/http_server.go
#	rpc/jsonrpc/server/http_server_test.go
#	rpc/jsonrpc/server/http_uri_handler.go
tac0turtle added a commit that referenced this pull request Mar 17, 2021
…#6204) (#6230)

* rpc/jsonrpc/server: return an error in WriteRPCResponseHTTP(Error) (#6204)

instead of panicking
Closes #5529

(cherry picked from commit 00b9524)

# Conflicts:
#	CHANGELOG_PENDING.md
#	rpc/jsonrpc/server/http_json_handler.go
#	rpc/jsonrpc/server/http_server.go
#	rpc/jsonrpc/server/http_server_test.go
#	rpc/jsonrpc/server/http_uri_handler.go

* resolve conflicts

* fix linting

* fix conflict

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
Co-authored-by: Marko Baricevic <marbar3778@yahoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S:backport-to-v0.34.x Tell mergify to backport the PR to v0.34.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RPC keeps panic when there are RPC requests
4 participants