With this change, the default dialer checks environment variables to see if proxy is needed. If so, it dials to the proxy and does an HTTP CONNECT handshake.
grpclb needs to connect the second resolved balancer address when the first balancer disconnects.
If grpclb gets 2 resolved addresses: balancer1 and balancer2. When balancer1 disconnects, grpclb should automatically start to use balancer2.
* use a global sharded pool of proto.Buffer caches in protoCodec
* fix goimports
* make global buffer pool index counter atomic
* hack to remove alloc in encode_len_struct
* remove extra slice alloc in proto codec marshal
* replce magic number for proto size field length with constant
* replace custom cache with sync.Pool
* remove 1 line functions in codec.go and add protoCodec microbenchmarks
* add concurrent usage test for protoCodec
* fix golint.gofmt,goimport checks
* fix issues in codec.go and codec_test.go
* use go parallel benchmark helpers
* replace proto.Codec with a guess of size needed
* update Fatalf -> Errorf in tests
* wrap proto.Buffer along with cached last size into larger struct for pool use
* make wrapped proto buffer only a literal
* fix style and imports
* move b.Run into inner function
* reverse micro benchmark op order to unmarshal-marshal and fix benchmark setup-in-test bug
* add test for large message
* remove use of defer in codec.marshal
* revert recent changes to codec bencmarks
* move sub-benchmarks into >= go-1.7 only file
* add commentfor marshaler and tweak benchmark subtests for easier usage
* move build tag for go1.7 on benchmarks to inside file
* move build tag to top of file
* comment Codec, embed proto.Buffer into cached struct and add an int32 cap
This will prevent the incoming RPCs' metadata from appearing in outgoing RPCs
unless it is explicitly copied, e.g.:
incomingMD, ok := metadata.FromContext(ctx)
if ok {
ctx = metadata.NewContext(ctx, incomingMD)
}
Fixes#1148
So context.String() won't race when printing %#v.
It is not thread-safe to call context.String() on any context with a
stream value since valueCtx will use %#v to access all of the Stream
fields without holding a lock. Instead, print the Stream's pointer and
method for its GoString.
When an error implemented by the status package is returned from a service
handler, the server will transmit a rich status message in the
"grpc-status-details-bin" trailing metadata field if any detailed data is
attached to the error. Client-side, we will decode them if present in the
server's response and return them to the user code performing the RPC.
This is backward compatible with the existing errors supported by the grpc
package. However, the grpc.Errorf, grpc.Code and grpc.ErrorDesc functions for
managing errors are now deprecated; status.Errorf and status.Status type
asserions should be used instead.
* add user and system cpu usage to go benchmarks
* fix import and style issues
* sample elapsed time diffs after merging histograms
* style fixes and variables renames
* add pprof server to benchmark workers to grab different profile stats
* rename variables for consistency and default to no pprof
Implementation of server enforcement of keepalive policy.
Server will close connection with a client that violates this policy.
Policy parameters:
- MinTime is the minimum amount of time a client should wait before sending a keepalive ping.
- If PermitWithoutStream true, server expects keepalive pings even when there are no active streams(RPCs).
The new logic added to the server does the following:
- Gracefully closes an idle connection after a duration of keepalive.MaxConnectionIdle.
- Gracefully closes any connection after a duration of keepalive.MaxConnectionAge.
- Forcibly closes a connection after an additive period of keepalive.MaxConnectionAgeGrace over keepalive.MaxConnectionAge.
- Makes sure a connection is alive by sending pings with a frequency of keepalive.Time and closes a non-resposive connection after an additional duration of keepalive.Timeout.