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: set pong read deadline - Fixes #23528 #23556

Merged
merged 2 commits into from Sep 27, 2021

Conversation

jmank88
Copy link
Contributor

@jmank88 jmank88 commented Sep 9, 2021

The first commit adds a (failing) test TestClientWebsocketSevered, which demonstrates a hanging subscription after severing the client's websocket connection, as in #23528. The test times out after 3 ping intervals.

The second commit fixes the test by adding a 30 second read timeout after each ping. This detects and discards severed connections after timing out, and subscriptions receive an error right away.

Fixes #23528

@jmank88 jmank88 changed the title rpc: add TestClientWebsocketSevered and set read deadline after ping rpc: add TestClientWebsocketSevered and set read deadline after ping - Fixes #23528 Sep 20, 2021
@jmank88 jmank88 changed the title rpc: add TestClientWebsocketSevered and set read deadline after ping - Fixes #23528 rpc: set pong read deadline - Fixes #23528 Sep 27, 2021
@jmank88
Copy link
Contributor Author

jmank88 commented Sep 27, 2021

@holiman Is there anything else I can do here?

@holiman
Copy link
Contributor

holiman commented Sep 27, 2021 via email

Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

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

LGTM

@holiman holiman added this to the 1.10.9 milestone Sep 27, 2021
@holiman holiman merged commit 51ececb into ethereum:master Sep 27, 2021
@jmank88 jmank88 deleted the severed-websocket branch September 27, 2021 14:40
yongjun925 pushed a commit to DODOEX/go-ethereum that referenced this pull request Dec 3, 2022
This PR adds a 30s timeout for the remote part to answer a ping message, thus detecting (silent) disconnnects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Websocket subscriptions do not get closed quickly if network connection is severed
2 participants