mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 02:43:36 +00:00
Fresh dep ensure
This commit is contained in:
46
vendor/google.golang.org/grpc/Documentation/keepalive.md
generated
vendored
Normal file
46
vendor/google.golang.org/grpc/Documentation/keepalive.md
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
# Keepalive
|
||||
|
||||
gRPC sends http2 pings on the transport to detect if the connection is down. If
|
||||
the ping is not acknowledged by the other side within a certain period, the
|
||||
connection will be close. Note that pings are only necessary when there's no
|
||||
activity on the connection.
|
||||
|
||||
For how to configure keepalive, see
|
||||
https://godoc.org/google.golang.org/grpc/keepalive for the options.
|
||||
|
||||
## What should I set?
|
||||
|
||||
It should be sufficient for most users to set [client
|
||||
parameters](https://godoc.org/google.golang.org/grpc/keepalive) as a [dial
|
||||
option](https://godoc.org/google.golang.org/grpc#WithKeepaliveParams).
|
||||
|
||||
## What will happen?
|
||||
|
||||
(The behavior described here is specific for gRPC-go, it might be slightly
|
||||
different in other languages.)
|
||||
|
||||
When there's no activity on a connection (note that an ongoing stream results in
|
||||
__no activity__ when there's no message being sent), after `Time`, a ping will
|
||||
be sent by the client and the server will send a ping ack when it gets the ping.
|
||||
Client will wait for `Timeout`, and check if there's any activity on the
|
||||
connection during this period (a ping ack is an activity).
|
||||
|
||||
## What about server side?
|
||||
|
||||
Server has similar `Time` and `Timeout` settings as client. Server can also
|
||||
configure connection max-age. See [server
|
||||
parameters](https://godoc.org/google.golang.org/grpc/keepalive#ServerParameters)
|
||||
for details.
|
||||
|
||||
### Enforcement policy
|
||||
|
||||
[Enforcement
|
||||
policy](https://godoc.org/google.golang.org/grpc/keepalive#ServerParameters) is
|
||||
a special setting on server side to protect server from malicious or misbehaving
|
||||
clients.
|
||||
|
||||
Server sends GOAWAY with ENHANCE_YOUR_CALM and close the connection when bad
|
||||
behaviors are detected:
|
||||
- Client sends too frequent pings
|
||||
- Client sends pings when there's no stream and this is disallowed by server
|
||||
config
|
15
vendor/google.golang.org/grpc/Documentation/proxy.md
generated
vendored
Normal file
15
vendor/google.golang.org/grpc/Documentation/proxy.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# Proxy
|
||||
|
||||
HTTP CONNECT proxies are supported by default in gRPC. The proxy address can be
|
||||
specified by the environment variables HTTP_PROXY, HTTPS_PROXY and NO_PROXY (or
|
||||
the lowercase versions thereof).
|
||||
|
||||
## Custom proxy
|
||||
|
||||
Currently, proxy support is implemented in the default dialer. It does one more
|
||||
handshake (a CONNECT handshake in the case of HTTP CONNECT proxy) on the
|
||||
connection before giving it to gRPC.
|
||||
|
||||
If the default proxy doesn't work for you, replace the default dialer with your
|
||||
custom proxy dialer. This can be done using
|
||||
[`WithDialer`](https://godoc.org/google.golang.org/grpc#WithDialer).
|
46
vendor/google.golang.org/grpc/Documentation/stickiness.md
generated
vendored
46
vendor/google.golang.org/grpc/Documentation/stickiness.md
generated
vendored
@ -1,46 +0,0 @@
|
||||
# Stickiness
|
||||
|
||||
With load balancer, each RPC pick a different backend based on the load
|
||||
balancing policy. Stickiness policies try to preserve peers for the duration of
|
||||
a session, so that RPCs with the same stickiness key will be directed to the
|
||||
same server.
|
||||
|
||||
Note that there's only "soft" stickiness now, which means RPCs with the same
|
||||
stickienss key could still be sent to different servers. If stickiness is
|
||||
critical for the system, server side application level handling is still
|
||||
necessary.
|
||||
|
||||
## Stickiness Key
|
||||
|
||||
A stickiness key works as the session id. RPCs with the same stickiness key will
|
||||
be assigned to the same backend.
|
||||
|
||||
Stickiness key is set as part of the custom metadata.
|
||||
|
||||
## Enable stickiness
|
||||
|
||||
Stickiness can be enabled by setting `stickinessKey` field in [service
|
||||
config](https://github.com/grpc/grpc/blob/master/doc/service_config.md).
|
||||
|
||||
```json
|
||||
{
|
||||
"stickinessKey": "sessionid"
|
||||
}
|
||||
```
|
||||
|
||||
The value `sesseionid` will be used as the key of the metadata entry that
|
||||
defines the stickiness key for each RPC.
|
||||
|
||||
## Send RPC with stickiness
|
||||
|
||||
To set the stickiness key for an RPC, set the corresponding metadata. The
|
||||
following RPC will be sent with stickiness key `session1`.
|
||||
|
||||
```go
|
||||
// "sessionid" is the metadata key specified by service config, "session1" is
|
||||
// the stickiness key for this RPC.
|
||||
md := metadata.Paris("sessionid", "session1")
|
||||
|
||||
ctx := metadata.NewOutgoingContext(context.Background(), md)
|
||||
resp, err := client.SomeRPC(ctx, req)
|
||||
```
|
Reference in New Issue
Block a user