sapling/server
Stanislau Hlebik b909f2bc9c mononoke: per wireproto command timeout
Summary:
Previously we had a timeout per session i.e. multiple wireproto command will
share the same timeout. It had a few disadvantages:

1) The main disadvantage was that if connection had timed out we didn't log
stats such as number of files, response size etc and we didn't log parameters
to scribe. The latter is even a bigger problem, because we usually want to
replay requests that were slow and timed out and not the requests that finished
quickly.

2) The less important disadvantage is that we have clients that do small
request from the server and then keep the connection open for a long time.
Eventually we kill the connection and log it as an error. With this change
the connection will be open until client closes it. That might potentially be
a problem, and if that's the case then we can reintroduce perconnection
timeout.

Initially I was planning to use tokio::util::timer to implement all the
timeouts, but it has different behaviour for stream - it only allows to set
per-item timeout, while we want timeout for the whole stream.
(https://docs.rs/tokio/0.1/tokio/timer/struct.Timeout.html#futures-and-streams)
To overcome it I implemented simple combinator StreamWithTimeout which does
exactly what I want.

Reviewed By: HarveyHunt

Differential Revision: D13731966

fbshipit-source-id: 211240267c7568cedd18af08155d94bf9246ecc3
2019-01-18 08:35:52 -08:00
..
context/src mononoke: Add PerfCounters struct to CoreContext 2019-01-16 09:11:17 -08:00
repo_listener/src mononoke: per wireproto command timeout 2019-01-18 08:35:52 -08:00
src Support TLS resumption on mononoke 2019-01-03 08:46:15 -08:00
Cargo.toml Add Cargo.toml files to crates. (#7) 2018-07-09 19:52:27 -07:00