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

protocols/request-response: Consider introdcuing InboundFailure::ConnectionClosed #1882

Closed
mxinden opened this issue Dec 9, 2020 · 0 comments · Fixed by #1886
Closed

protocols/request-response: Consider introdcuing InboundFailure::ConnectionClosed #1882

mxinden opened this issue Dec 9, 2020 · 0 comments · Fixed by #1886
Assignees

Comments

@mxinden
Copy link
Member

mxinden commented Dec 9, 2020

Today the request response NetworkBehaviour might not always emit an InboundFailure for all inbound requests that failed to be answered. More specifically in case the connection to the peer closes after RequestResponse::send_response has been called the response will be dropped but no InboundFailure event will be emitted.

/// An inbound request failed.
///
/// > **Note**: The case whereby a connection on which a response is sent
/// > closes after [`RequestResponse::send_response`] already succeeded
/// > but before the response could be sent on the connection is reflected
/// > by there being no [`RequestResponseEvent::ResponseSent`] event.
/// > Code interested in ensuring a response has been successfully
/// > handed to the transport layer, e.g. before continuing with the next
/// > step in a multi-step protocol, should listen to these events.
InboundFailure {

Also see paritytech/substrate#7696 (comment).

Consider tracking inbound requests in the NetworkBehaviour in order to be able to detect the above scenario and emit an InboundFailure::ConnectionClosed event.

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 a pull request may close this issue.

1 participant