Commit Graph

400 Commits

Author SHA1 Message Date
khappucino 87fb677cdf Minor spelling error in connection.rs comments (#145)
Signed-off-by: David Capino <david.capino@gmail.com>
2018-11-29 20:02:03 -08:00
Oliver Gould 52a2bf5a3e
canonicalize: Drive resolution on a background task (#146)
canonicalize: Drive resolution on a background task

canonicalize::Service::poll_ready may not be called enough to drive
resolution, so a background task must be spawned to watch DNS.

Updates are published into service over an mpsc, so the task exits
gracefully when the service is dropped.
2018-11-29 17:28:51 -08:00
Oliver Gould 82524e4a1f
Apply tapping logic only when taps are active (#142)
Previously, as the proxy processed requests, it would:

Obtain the taps mutex ~4x per request to determine whether taps are active.
Construct an "event" ~4x per request, regardless of whether any taps were
active.
Furthermore, this relied on fragile caching logic, where the grpc server
manages individual stream states in a Map to determine when all streams have
been completed. And, beyond the complexity of caching, this approach makes it
difficult to expand Tap functionality (for instance, to support tapping of
payloads).

This change entirely rewrites the proxy's Tap logic to (1) prevent the need
to acquire muteces in the request path, (2) only produce events as needed to
satisfy tap requests, and (3) provide clear (private) API boundaries between
the Tap server and Stack, completely hiding gRPC details from the tap service.

The tap::service module now provides a middleware that is generic over a
way to discover Taps; and the tap::grpc module (previously,
control::observe), implements a gRPC service that advertises Taps such that
their lifetimes are managed properly, leveraging RAII instead of hand-rolled
map-based caching.

There is one user-facing change: tap stream IDs are now calculated relative to
the tap server. The base id is assigned from the count of tap requests that have
been made to the proxy; and the stream ID corresponds to an integer on [0, limit).
2018-11-29 17:12:48 -08:00
Sean McArthur edd124fa9f
Dockerfile: copy all lib crates before fetching dependencies (#143)
Signed-off-by: Sean McArthur <sean@buoyant.io>
2018-11-28 11:26:08 -08:00
Sean McArthur 88340cadf3 replace proxy::http usage of tower-h2 with hyper
Signed-off-by: Sean McArthur <sean@buoyant.io>
2018-11-27 17:29:18 -08:00
Oliver Gould 5d93690045
tests: Replace `uimplemented!` with 'unreachable!' (#141)
When developing, it's convenient to use `unimplemented!` as a
placeholder for work that has not yet been done. However, we also use
`unimplemented!` in various tests in stubbed methods; so searching the
project for `unimplemented` produces false positives.

This change replaces these with `unreachable!`, which is functionaly
equivalent, but better indicates that the current usage does not reach
these methods and disambiguates usage of `unimplemented!`.
2018-11-27 14:27:30 -08:00
Luca Bruno 4f9adf9ca4 metrics/counter: wrap values over 2^53 (#139)
This implements Prometheus reset semantics for counters, in order to
preserve precision when deriving rate of increase.
Wrapping is based on the fact that Prometheus models counters as `f64`
(52-bits mantissa), thus integer values over 2^53 are not guaranteed to
be correctly exposed.

Signed-off-by: Luca Bruno <luca.bruno@coreos.com>
2018-11-18 08:05:15 -08:00
Oliver Gould 663eab43dc
Reduce log level for orig-proto-downgrade (#138)
Using a downgrade stack is not sufficiently important to log at the INFO
level. Log it at DEBUG.
2018-11-16 13:19:06 -08:00
Oliver Gould 2ab7ce2e67
Delete the ctx module (#137)
The `ctx` module is no longer used. It can safely be deleted.
2018-11-16 12:28:28 -08:00
Sean McArthur cde7675a9a Ensure l5d-orig-proto header is removed before returning responses
Signed-off-by: Sean McArthur <sean@buoyant.io>
2018-11-16 12:10:29 -08:00
Sean McArthur f37c9e5128 Update all tower pieces to use Service<Request> (#132)
Signed-off-by: Sean McArthur <sean@buoyant.io>
2018-11-16 11:19:17 -08:00
Oliver Gould 7add0db68e
Disable debug symbols for tests (#135)
Our test artifacts end up consuming several GB of disk space, largely
due to debug symbols. This can prevent CI from passing, as CI hosts only
have about 9G of real estate.

By disabling debug symbols, we reduce artifact size by >90% (and total
target directory size from 14G to 4G).
2018-11-16 10:03:42 -08:00
Toby Lawrence 1cd340ccaa Fix Slack signup link in README. (#133)
Signed-off-by: Toby Lawrence <toby@nuclearfurnace.com>
2018-11-15 20:12:46 -08:00
Oliver Gould 9a9d929e34
Add controller client metrics (#131)
There is no telemetry from the controller client currently.

This change adds a new scope (`control_`) of metrics including HTTP
metrics for the client to the proxy-api.
2018-11-15 15:30:12 -08:00
Alex Leong c970a8c173 Add never lib to Dockerfile (#130)
Signed-off-by: Alex Leong <alex@buoyant.io>
2018-11-15 11:45:28 -08:00
Oliver Gould d5e2ff2cb7
Canonicalize outbound names via DNS for inbound profiles (#129)
When the inbound proxy receives requests, these requests may have
relative `:authority` values like _web:8080_. Because these requests can
come from hosts with a variety of DNS configurations, the inbound proxy
can't make a sufficient guess about the fully qualified name (e.g.
_web.ns.svc.cluster.local._).

In order for the inbound proxy to discover inbound service profiles, we
need to establish some means for the inbound proxy to determine the
"canonical" name of the service for each request.

This change introduces a new `l5d-dst-canonical` header that is set by
the outbound proxy and used by the remote inbound proxy to determine
which profile should be used.

The outbound proxy determines the canonical destination by performing
DNS resolution as requests are routed and uses this name for profile and
address discovery. This change removes the proxy's hardcoded Kubernetes
dependency.

The `LINKERD2_PROXY_DESTINATION_GET_SUFFIXES` and
`LINKERD2_PROXY_DESTINATION_PROFILE_SUFFIXES` environment variables
control which domains may be discovered via the destination service.

Finally, HTTP settings detection has been moved into a dedicated routing
layer at the "bottom" of the stack. This is done do that
canonicalization and discovery need not be done redundantly for each set
of HTTP settings. Now, HTTP settings, only configure the HTTP client
stack within an endpoint.

Fixes linkerd/linkerd2#1798
2018-11-15 11:41:17 -08:00
Sean McArthur 21887e57e4 change Inbound to always use localhost
Signed-off-by: Sean McArthur <sean@buoyant.io>
2018-11-14 15:59:48 -08:00
Oliver Gould fbadd969ce
Remove the `timestamp_request_open` module (#128)
The `timestamp_request_open` module is no longer used.  It can safely be
removed.
2018-11-13 15:35:55 -08:00
Sean McArthur 1595b2457d convert several Stack unit errors into Never
Since this stack pieces will never error, we can mark their
`Error`s with a type that can "never" be created. When seeing an `Error
= ()`, it can either mean the error never happens, or that the detailed
error is dealt with elsewhere and only a unit is passed on. When seeing
`Error = Never`, it is clearer that the error case never happens.
Besides helping humans, LLVM can also remove the error branchs entirely.

Signed-off-by: Sean McArthur <sean@buoyant.io>
2018-11-13 11:55:41 -08:00
Oliver Gould 00b4009525
Allow routers to be implemented with a closure (#126)
The router's `Recognize` trait is now essentially a function.

This change provides an implementation of `Recognize` over a `Fn` so
that it's possible to implement routers without defining 0-point marker
types that implement `Recognize`.
2018-11-13 09:57:08 -08:00
Oliver Gould 2d2d209e4e
Implement Error for svc::Either (#125)
The `linkerd2_stack::Either` type is used to implement Layer, Stack, and
Service for alternate underlying implementations. However, the Service
implementation requires that both inner services emit the same type of
Error.

In order to allow the underlying types to emit different errors, this
change uses `Either` to wrap the underlying errors, and implements
`Error` for `Either`.
2018-11-13 09:56:46 -08:00
Oliver Gould 4d3e0abd41
Ensure metrics are not evicted for active routes (#124)
It was possible for a metrics scope to be deregistered for active
routes. This could cause metrics to disappear and never be recorded in
some situations.

This change ensure that metrics are only evicted for scopes that are not
active (i.e. in a router, load balancer, etc).
2018-11-12 18:50:36 -08:00
Oliver Gould d396acda6d
Fall-back to former classification logic with profiles (#123)
With the introduction of profile-based classification, the proxy would
not perform normal gRPC classification in some cases when it could &
should.

This change simplifies our default classifier logic and falls back to
the default grpc-aware behavior whenever another classification cannot
be performed.

Furthermore, this change moves the `proxy::http::classify` module to
`proxy::http::metrics::classify`, as these modules should only be relied
on for metrics classification. Other module (for instance, retries),
should provide their own abstractions.

Finally, this change fixes a test error-formatting issue.
2018-11-12 18:22:12 -08:00
Oliver Gould c4b3765574
Unify Name/Host/Addr types under Addr (#120)
Currently, the proxy uses a variety of types to represent the logical
destination of a request. Outbound destinations use a `NameAddr` type
which may be either a `DnsNameAndPort` or a `SocketAddr`. Other parts of
the code used a `HostAndPort` enum that always contained a port and also
contained a `Host` which could either be a `dns::Name` or a `IpAddr`.
Furthermore, we coerce these types into a `http::uri::Authority` in many
cases.

All of these types represent the same thing; and it's not clear when/why
it's appropriate to use a given variant.

In order to simplify the situtation, a new `addr` module has been
introduced with `Addr` and `NameAddr` types. A `Addr` may
contain either a `NameAddr` or a `SocketAddr`.

The `Host` value has been removed from the `Settings::Http1` type,
replaced by a boolean, as it's redundant information stored elsewhere in
the route key.

There is one small change in behavior: The `authority` metrics label is
now omitted only for requests that include an `:authority` or `Host`
with a _name_ (i.e. and not an IP address).
2018-11-08 14:49:42 -08:00
Oliver Gould 5e0a15b8a7
Introduce outbound route metrics (#117)
The Destination Profile API---provided by linkerd2-proxy-api v0.1.3--
allows the proxy to discovery route information for an HTTP service. As
the proxy processes outbound requests, in addition to doing address
resolution through the Destination service, the proxy may also discover
profiles including route patterns and labels.

When the proxy has route information for a destination, it applies the
RequestMatch for each route to find the first-matching route. The
route's labels are used to expose `route_`-prefixed HTTP metrics (and
each label is prefixed with `rt_`).

Furthermore, if a route includes ResponseMatches, they are used to
perform classification (i.e. for the `response_total` and
`route_response_total` metrics).

A new `proxy::http::profiles` module implements a router that consumes
routes from an infinite stream of route lists.

The `app::profiles` module implements a client that continually and
repeatedly tries to establish a watch for the destination's routes (with
some backoff).

Route discovery does not _block_ routing; that is, the first request to
a destination will likely be processed before the route information is
retrieved from the controller (i.e. on the default route). Route
configuration is applied in a best-effort fashion.
2018-11-05 16:30:39 -08:00
Oliver Gould 0b6e35857b
Upgrade trust-dns-resolver to 0.10.0 (#118) 2018-11-02 11:28:22 -07:00
Oliver Gould 8fca9ebde2
Only use the classification label for response_total (#116)
As described in https://github.com/linkerd/linkerd2/issues/1832, our eager
classification is too complicated.

This changes the `classification` label to only be used with the `response_total` label.

The following changes have been made:
1. response_latency metrics only include a status_code and not a classification.
2. response_total metrics include classification labels.
3. transport metrics no longer expose a `classification` label (since it's misleading).
   now the `errno` label is set to be empty when there is no error.
4. Only gRPC classification applies when the request's content type starts
   with `application/grpc+`

The `proxy::http::classify` APIs have been changed so that classifiers cannot
return a classification before the classifier is fully consumed.
2018-11-01 14:59:44 -07:00
Oliver Gould 19606bd528
refactor: Use a stack-based controller client (#115)
The controller's client is instantiated in the
`control::destination::background` module and is tightly coupled to its
use for address resolution.

In order to share this client across different modules---and to bring it
into line with the rest of the proxy's modular layout---the controller
client is now configured and instantiated in `app::main`. The
`app::control` module includes additional stack modules needed to
configure this client.

Our dependency on tower-buffer has been updated so that buffered
services may be cloned.

The `proxy::reconnect` module has been extended to support a
configurable fixed reconnect backoff; and this backoff delay has been
made configurable via the environment.
2018-11-01 11:21:38 -07:00
Oliver Gould f97239baf0
Use the grpc-status response header for classification (#113)
When a gRPC service fails a request eagerly, before it begins sending a
response, a `grpc-status` header is simply added to the initial response
header (rather than added to trailers).

This change ensures that classification honors these status codes.

Fixes linkerd/linkerd2#1819
2018-10-30 11:03:31 -07:00
Oliver Gould 81b83784f0
Prepare HTTP metrics for per-route classification (#112)
Previously, stacks were built with `Layer::and_then`. This pattern
severely impacts compile-times as stack complexity grows.

In order to ameliorate this, `app::main` has been changed to build
stacks from the "bottom" (endpoint client) to "top" (serverside
connection) by _push_-ing Layers onto a concrete stack, i.e. and not
composing layers for an abstract stack.

While doing this, we take the oppportunity to remove a ton of
now-unnecessary `PhantomData`. A new, dedicated `phantom_data` stack
module can be used to aid type inference as needed.

Other stack utilities like `map_target` and `map_err` have been
introduced to assist this transition.

Furthermore, all instances of `Layer::new` have been changed to a free
`fn layer` to improve readability.

This change sets up two upcoming changes: a stack-oriented `controller`
client and, subsequently, service-profile-based routing.

* Prepare HTTP metrics for per-route classification

In order to support Service Profiles, the proxy will add a new scope of
HTTP metrics prefixed with `route_`, i.e. so that the proxy exposes
`request_total` and `route_request_total` independently.

Furthermore, the proxy must be able to use different
response-classification logic for each route, and this classification
logic should apply to both metrics scopes.

This alters the `proxy::http::metrics` module so that:

1. HTTP metrics may be scoped with a prefix (as the stack is described).

2. The HTTP metrics layer now discovers the classifier by trying to
   extract it from each request's extensions or fall back to a `Default`
   implementation. Only a default implementation is used presently.

3. It was too easy to use the `Classify` trait API incorrectly.
   Non-default classify implementation could cause a runtime panic!
   The API has been changed so that the type system ensures correct
   usage.

4. The HTTP classifier must be configurable per-request. In order to do
   this, we expect a higher stack layer will add response classifiers to
   request extensions when appropriate (i.e., in a follow-up).

Finally, the `telemetry::Report` type requires updating every time a new
set of metrics is added. We don't need a struct to represent this.
`FmtMetrics::and_then` has been added as a combinator so that a fixed
type is not necessary.
2018-10-30 10:47:33 -07:00
Oliver Gould 4e0a1f0100
refactor: Build stacks from bottom-to-top (#111)
Previously, stacks were built with `Layer::and_then`. This pattern
severely impacts compile-times as stack complexity grows.

In order to ameliorate this, `app::main` has been changed to build
stacks from the "bottom" (endpoint client) to "top" (serverside
connection) by _push_-ing Layers onto a concrete stack, i.e. and not
composing layers for an abstract stack.

While doing this, we take the oppportunity to remove a ton of
now-unnecessary `PhantomData`. A new, dedicated `phantom_data` stack
module can be used to aid type inference as needed.

Other stack utilities like `map_target` and `map_err` have been
introduced to assist this transition.

Furthermore, all instances of `Layer::new` have been changed to a free
`fn layer` to improve readability.

This change sets up two upcoming changes: a stack-oriented `controller`
client and, subsequently, service-profile-based routing.
2018-10-29 14:02:42 -07:00
Oliver Gould 70d2f57e21
Make `resolve` a stack module (#106)
The `proxy::http::balance` module uses the `proxy::resolve::Resolve`
trait to implement a `Discover`.

This coupling between the balance and resolve modules prevents
integrating the destination profile API such that there is a per-route,
per-endpoint stack.

This change makes the `balance` stack generic over a stack that produces
a `Discover`. The `resolve` module now implements a stack that produces
a `Discover` and is generic over a per-endpoint stack.
2018-10-26 15:49:31 -07:00
Oliver Gould af4dd6fff3
Use rust:1.30.0 in development builds (#110) 2018-10-26 15:43:08 -07:00
Oliver Gould 6f031bdca0
Introduce an optional fixed backoff between reconnects (#105)
The control client implements a backoff service that dampens reconnect
attempts to the control plane by waiting a fixed period of time after a
failure.

Furthermore, the control client logs errors each time a reconnect
attempt fails.

This change moves backoff logic from
control::destination::background::client to proxy::reconnect.

Because the reconnect module handles connection errors uniformly, muting
repeated errors, it also has enough context to know when a backoff
should be applied -- when the underlying NewService cannot produce a
Service.

If polling the inner service fails once the Service has been
established, we do not want to apply a backoff, since this may
just be the result of a connection being terminated, a process being
restarted, etc.
2018-10-26 15:03:40 -07:00
Sean McArthur 66b1731f19 include address in TCP connect error messages
Signed-off-by: Sean McArthur <sean@buoyant.io>
2018-10-26 14:59:59 -07:00
Sean McArthur 68ec7f1488 fix test import conflict of assert_contains macro
Signed-off-by: Sean McArthur <sean@buoyant.io>
2018-10-26 14:21:26 -07:00
Oliver Gould 2109f37531
Make a generic Watch stack (#104)
The TLS-configuration-watching logic in `app::outbound::tls_config` need
not be specific to the outbound types, or even TLS configuration.

Instead, this change extends the `watch` stack module with a Stack type
that can satisfy the TLS use case independently of the concrete types at
play.
2018-10-26 13:30:09 -07:00
Sean McArthur 4625302bd9
Remove panic when failing to get remote address (#107)
The listener *already* got the remote address when it was accepted, but we drop the value by using `TcpListener::incoming`. By the time we call `socket.peer_addr()`, the connection may have been closed, and thus we were panicking.

By removing the panic here, later code should notice that the connection is closed (when a `read` finds EOF), and it should be dropped gracefully.

For the same reasons (that the connection might already be closed), this reduces the `error!` from `get_original_dst` to just a `warn!`, just as `set_nodelay` is a `warn!`. No need to yell in that case.

Closes https://github.com/linkerd/linkerd2/issues/1787

Signed-off-by: Sean McArthur <sean@buoyant.io>
2018-10-19 14:44:22 -07:00
Oliver Gould f1210b4947
Decouple reconnect & connect layers from proxy::http::client (#101)
Previously, the `client` module was responsible for instrument
reconnects. Now, the reconnect module becomes its own stack layer that
composes over NewService stacks.

Additionally, the `proxy::http::client` module can now layer over an
underlying Connect stack.
2018-10-11 16:08:25 -07:00
Oliver Gould 978fed1cf6
refactor: Structure the proxy in terms of `Stack` (#100)
As the proxy's functionality has grown, the HTTP routing functionality
has become complex. Module boundaries have become ill-defined, which
leads to tight coupling--especially around the `ctx` metadata types and
`Service` type signatures.

This change introduces a `Stack` type (and subcrate) that is used as the
base building block for proxy functionality. The `proxy` module now
exposes generic components--stack layers--that are configured and
instantiated in the `app::main` module.

This change reorganizes the repo as follows:
- Several auxiliary crates have been split out from the `src/` directory
  into `lib/fs-watch`, `lib/stack` and `lib/task`.
- All logic specific to configuring and running the linkerd2 sidecar
  proxy has been moved into `src/app`. The `Main` type has been moved
  from `src/lib.rs` to `src/app/main.rs`.
- The `src/proxy` has reusable, generic components useful for building
  proxies in terms of `Stack`s.

The logic contained in `lib/bind.rs`, pertaining to per-endpoint service
behavior, has almost entirely been moved into `app::main`.

`control::destination` has changed so that it is not responsible for
building services. (It used to take a clone of `Bind` and use it to
create per-endpoint services). Instead, the destination service
implements the new `proxy::Resolve` trait, which produces an infinite
`Resolution` stream for each lookup. This allows the `proxy::balance`
module to be generic over the servie discovery source.

Furthermore, the `router::Recognize` API has changed to only expose a
`recgonize()` method and not a `bind_service()` method. The
`bind_service` logic is now modeled as a `Stack`.

The `telemetry::http` module has been replaced by a
`proxy::http::metrics` module that is generic over its metadata types
and does not rely on the old telemetry event system. These events are
now a local implementation detail of the `tap` module.

There are no user-facing changes in the proxy's behavior.
2018-10-11 11:25:03 -07:00
Eliza Weisman 51db6f8be8
Change trust-dns-resolver to a version rather than git dependency (#103)
This branch changes the proxy's `trust-dns-resolver` dependency to a
version dependency rather than a Git dependency, since the
`0.10.0-alpha.3` version has the features that we previously required
the git dependency for.

The only changes to the proxy codebase itself were fixes for deprecation
warnings introduced by the dependency upgrade, since it was necessary to
update the minimum `tokio_timer` version as `trust-dns-proto` uses APIs
added in `tokio-timer` v0.2.6. In particular, `tokio_timer::Deadline`
was deprecated and replaced by `Timeout`.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-10-10 13:10:36 -07:00
Oliver Gould 977ff25cb9
Make config variable naming uniform (#99)
There are a few crufty remaining references to the `private` and
`public` proxy interfaces. `private` referred to the pod-local side of
the proxy; and `public` the external side.

These terms have been replaced by `inbound` and `outbound` proxies.

The "private forward address" is now the "inbound forward address".
The "private listener" is now the "outbound listener".
The "public listener" is now the "inbound listener".

This change adds alternate environment variables to support configuration:
- `LINKERD2_PROXY_INBOUND_CONNECT_TIMEOUT`
- `LINKERD2_PROXY_INBOUND_FORWARD`
- `LINKERD2_PROXY_INBOUND_LISTENER`
- `LINKERD2_PROXY_OUTBOUND_CONNECT_TIMEOUT`
- `LINKERD2_PROXY_OUTBOUND_LISTENER`

The old configuration variables have not been removed. Instead, a
warning is logged when such a variable is used to configure the proxy.
2018-10-03 07:51:54 -07:00
Oliver Gould b4ced35838
Fix linkerd2-metrics test compilation (#98)
* Fix linkerd2-metrics test compilation

The `quickcheck` dependency was lost when the subcrate was split out.
This change restores the dependency.

Fixes linkerd/linkerd2#1685

* Run tests for all packages in `make test`
2018-09-18 16:16:56 -07:00
Oliver Gould a4d4110776
Create a `lib` dir for subcrates (#97)
As we extract subcrates from the `src/` directory, the repository root
becomes a bit cluttered. This change moves these subcrates into a `lib`
directory.
2018-09-18 16:02:31 -07:00
Oliver Gould 53a85f442a
Split the `timeout` module into its own subcrate (#96)
The `timeout` module has very little to do with the proxy, specifically.

This change moves it into a dedicated subcrate. This helps to clarify
dependencies and to minimize generic logic in the main proxy crate.

In doing this, an unused implementation of AsyncRead/AsyncWrite for
Timeout was deleted.

Furthermore, the `HumanDuration` type has been copied into
tests/support/mod.rs so that this type need not be part of the timeout
module's public API.
2018-09-18 15:09:31 -07:00
Sean McArthur 0861f968d7 update hyper to v0.12.9
Signed-off-by: Sean McArthur <sean@buoyant.io>
2018-09-14 13:36:02 -07:00
Sean McArthur 66d59dafde update http to v0.1.13
Signed-off-by: Sean McArthur <sean@buoyant.io>
2018-09-14 13:36:02 -07:00
Oliver Gould 567b1b7ff2
Move bind::NormalizeUri to its own module in proxy::http (#94)
Split proxy infrastructure from `bind`

In order to simplify `bind.rs`, this change moves `NormalizeUri` into
its own module, `proxy::http::normalize_uri`.

This will later become part of the "client stack" built from
`proxy::http`.
2018-09-13 16:43:50 -07:00
Oliver Gould bbf296668b
Move HTTP-specific `proxy` modules into proxy::http (#93)
To prepare to move http-specific proxying logic from bind.rs into
proxy, let's carve out a proxy::http module for HTTP-specific behavior.
2018-09-13 13:45:56 -07:00
Oliver Gould ccd5d21978
Introduce a "server stack" (#90)
Previously, `proxy::Server` was generic over a `NewService` (constructed
in `lib.rs`) that instruments error handling around the router and metrics. In
preparation of adding a metrics module into the server stack (that is configured
by the source connection), `Server` should be changed to instantaneously build
clients with a `MakeClient<Arc<ctx::transport::Server>>`.

In order to do this, the following changes were made:

1. The `svc::NewClient` type was changed to `svc::MakeClient<Target>`. The
    naming change ("New" to "Make") is intended to differentiate the type from
    `NewService`, which is asynchronous and does not accept a `Target` argument.
2. The `proxy::h2_router` module was split from `lib.rs` and `map_err.rs`.  `MapErr`
    tried to be generic, though we only used it in once place. Now, the `h2_router::Make`
    type supports cloning routers and handling their errors.
3. The `TimestampRequestOpen` middleware was split into its own file and given a
    `MakeClient` implementation.
4. The `svc::Layer` trait has been introduced to support layering middlewares like
    `TimestampRequestOpen`. This is analogous to Finagle's `Stack.Module` type.

There are no functional changes.
2018-09-11 16:47:25 -07:00