Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

LES: Better timeouts + Track failed requests #4093

Merged
merged 6 commits into from
Jan 18, 2017
Merged

Conversation

rphmeier
Copy link
Contributor

@rphmeier rphmeier commented Jan 9, 2017

Closes #3984, #4037

The timeout mechanism introduced is managed by the RequestSet struct: since the flow mechanism and request IDs allow us to make multiple requests of a peer, we need to have a sensible timeout scheme which doesn't overload the peer with requests and then drop them when they fail to respond.

The RequestSet allows the peer to respond in the worst case as slowly as if requests were only dispatched one-by-one, while allowing the peer to respond to requests in a relatively arbitrary order (but assuming that earlier-dispatched requests will tend to be responded to first -- this enforces that no request is left unanswered indefinitely to mitigate some kinds of DoS attacks).

Malformatted/bad responses now correctly have their ReqId passed to handlers as part of a disconnected peer's unfulfilled set. This is accomplished by having an id_guard which must be defused in order to access the inner ReqId upon correct decoding. If not defused, the request id will be added to the peer's failed_requests set.

@rphmeier rphmeier added A1-onice 🌨 Pull request is reviewed well, but should not yet be merged. M4-core ⛓ Core client code / Rust. labels Jan 9, 2017
@rphmeier rphmeier changed the title Better timeouts + Track failed requests LES: Better timeouts + Track failed requests Jan 9, 2017
@rphmeier rphmeier added A0-pleasereview 🤓 Pull request needs code review. and removed A1-onice 🌨 Pull request is reviewed well, but should not yet be merged. labels Jan 10, 2017
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.9%) to 84.649% when pulling d515ef9 on better-timeouts into 4c94878 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 84.76% when pulling e88c62d on better-timeouts into 844b1f8 on master.

@arkpar arkpar added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jan 18, 2017
@rphmeier rphmeier merged commit 3040a1c into master Jan 18, 2017
@rphmeier rphmeier deleted the better-timeouts branch January 18, 2017 14:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants