3119 Commits

Author SHA1 Message Date
9f02faeffa credentials: move TLS implementation to a separate file (#3243) 2019-12-11 13:11:24 -08:00
021bd5734e profiling: add internal changes to support profiling of gRPC (#3158) 2019-12-11 09:06:38 -08:00
505c0d6440 xds: skip callback if xds client reports error (#3240)
Errors will be handled specifically, depending on whether it's a
connection error or other types of errors.

Without this fix, balancer's callback will be called with <nil> update,
causing nil panic later.
2019-12-10 14:03:21 -08:00
81a07a98fe internal: Improve documentation around buffer.Unbounded (#3241) 2019-12-10 13:45:32 -08:00
3a4f66e0ed xds: small fixes (#3238)
- install cds balancer by importing package cdsbalancer
 - `net.SplitHostPort` fails when target doesn't have port, but we want to use the original string instead
2019-12-10 12:49:47 -08:00
11399004a9 xds: resolver test cleanup (#3233)
This PR also adds a new testutils directory with a fake client and a
channel which supports a timed receive operation. In follow up PRs, we
can move other common test stuff like the fake server etc to this
directory and cleanup more tests.
2019-12-10 11:20:06 -08:00
a4e9d9553d xds: Update the check for match field when handling an RDS response. (#3239)
The client will look only at the last route in the list (the default
route), whose match field must contain a prefix field whose value is the
empty string and whose route field must be set.
2019-12-10 10:47:05 -08:00
86c8a0cb87 xds/resolver: Add missing double quote in json SC (#3232) 2019-12-06 15:39:45 -08:00
3180dcb49d server.go: combine defers to reduce stack usage (#3208)
Continuing the war on stacks, we can reduce the amount of stack required
per-RPC by combining defers from different components into one.

Each defer statement in process{Unary,Streaming}RPC goes on the stack
and occupies about 56-64 bytes the entire lifetime of an RPC, which
could be very long. More importantly, a call to runtime.morestack is
often required to allocate a new, larger stack when the handler
goroutine runs out of stack memory (Go's default stack size is 2 KiB).

Before:

    $ go tool objdump <binary> | grep "TEXT.*processUnaryRPC(SB)" -A 10 | grep "SUBQ.*SP"
      server.go:867   0x9132fb    4881ec80030000      SUBQ $0x380, SP
    $ go tool objdump <binary> | grep "TEXT.*processStreamingRPC(SB)" -A 10 | grep "SUBQ.*SP"
      server.go:1099  0x9151bb    4881ec68020000      SUBQ $0x268, SP

After:

    $ go tool objdump <binary> | grep "TEXT.*processUnaryRPC(SB)" -A 10 | grep "SUBQ.*SP"
      server.go:867   0x9132fb    4881ecd0020000      SUBQ $0x2d0, SP
    $ go tool objdump <binary> | grep "TEXT.*processStreamingRPC(SB)" -A 10 | grep "SUBQ.*SP"
      server.go:1116  0x9150fb    4881ecf8010000      SUBQ $0x1f8, SP

As one can observe, the processUnaryRPC's stack goes down from 0x380
bytes to 0x2d0 bytes (896 - 720 = 176 bytes) while processStreamingRPC's
stack goes down from 0x2d8 bytes to 0x1f8 bytes (616 - 504 = 112 bytes).

There are probably other things we can do here, but these are some low
hanging fruits to pick off.
2019-12-05 14:50:20 -08:00
da3b1eb45e xds: Implementation of the CDS LB policy. (#3224) 2019-12-05 09:52:43 -08:00
6f8ce09297 dns: reapply "dns: stop polling for updates; use UpdateState API" (#3228) 2019-12-05 08:08:29 -08:00
895b36ddf2 travis: run interop tests with examples (#3229) 2019-12-04 15:55:45 -08:00
14426e9c3a credentials/alts: Ensure that GetBytesConsumed is in-bound (#3225) 2019-12-03 22:21:17 -08:00
22854c88e0 credentials/alts: Simplify ALTS acquire and release APIs (#3221) 2019-12-03 15:43:33 -08:00
645dd12f13 alts: Update handshaker.pb.go 2019-12-03 15:28:59 -08:00
1e36139a79 credentials/alts: Set the handshake extra slice correctly (#3222) 2019-12-03 11:01:32 -08:00
4b2104f1fb xds: change lrs server name field in xds balancer config to a string pointer (#3210)
LRS is disabled if this field is nil (is unset in json). The xds server
will be used if it's a pointer to an empty string.
2019-11-27 15:11:47 -08:00
9dc72d1df0 Revert "dns: stop polling for updates; use UpdateState API" (#3213)
This reverts commit e5e980f2766388fc243cc4cf20c59b9c13affa8c.
2019-11-26 16:07:43 -08:00
157dc9f3e4 xds: cleanup eds tests to use fakexds server (#3209)
And move LRS test server to fakexds package.
2019-11-26 15:53:20 -08:00
7e7050be6a xds: Minor refactoring, prep for CDS LB policy (#3211) 2019-11-26 11:11:54 -08:00
d8e3da36ac xds: in EDS balancer, use xds_client from attibutes (#3205) 2019-11-25 14:50:28 -08:00
1c4070c2e9 xds: CDS implementation in v2Client. (#3203) 2019-11-25 09:14:33 -08:00
e5e980f276 dns: stop polling for updates; use UpdateState API (#3165) 2019-11-22 15:48:45 -08:00
cb47f381a7 dns: do not call NewServiceConfig when lookups are disabled (#3201) 2019-11-22 13:38:04 -08:00
da649b3624 xds: use the shared xds client in eds balancer (#3197)
This PR removes the xds_client implementation from eds balancer, and replaces it with a xds_client wrapper. (The xds_client wrapper has very similar API as the old xds_client implementation, so the change in the eds balancer is minimal).

The eds balancer currently doesn't look for xds_client from attributes, and always creates a new xds_client. The attributes change will be done in a following up change.
2019-11-21 14:10:04 -08:00
0e8c6a3281 github: make stalebot monitor PRs, too (#3202) 2019-11-21 12:37:51 -08:00
dc49de8acd balancer: add V2Picker, ClientConn.UpdateState, SubConnState.ConnectionError (#3186)
Also implement V2 versions of base.*, xds, pickfirst, grpclb, and round robin balancers.
2019-11-21 10:27:29 -08:00
7c1d326729 benchmark: Enable server keepalive in benchmarks (#3196) 2019-11-20 09:06:10 -08:00
24b653e8cc xds: Don't override dialFunc in xdsClient in tests. (#3191)
* Add a helper to the fakexds package to return a ClientConn talking to
  the fake server.
* Tests will make use of this ClientConn wherever required, or they will
  directly pass the fake server's address as the balancerName to the
  xdsclient.New() function, thus exercising that code path as well.
* Add grpc.WithTimeout to list in vet.sh
2019-11-20 09:02:53 -08:00
d720ab346f server: Keepalive pings should be sent every [Time] period (#3172)
This PR contains the server side changes corresponding to the client
side changes made in https://github.com/grpc/grpc-go/pull/3102.

Apart from the fix for the issue mentioned in
https://github.com/grpc/grpc-go/issues/2638, this PR also makes some
minor code cleanup and fixes the channelz test for keepalives count.
2019-11-19 14:43:22 -08:00
24f6331d7e server: correct doc regarding unknown handlers and interceptors (#3195) 2019-11-19 14:30:36 -08:00
5d4cc8affe xds: Implementation of xds_resolver using LDS/RDS (#3183)
xds: Implementation of xds_resolver using LDS/RDS
2019-11-18 17:46:14 -08:00
71ba135a58 xds: handle EDS in xds client (#3181) 2019-11-18 15:17:21 -08:00
967379b15b client: set grpc-accept-encoding header based on outgoing compressor (#3139) 2019-11-18 09:44:48 -08:00
347a6b4db3 stats: attach metadata to In/Out Headers/Trailers (#3169) 2019-11-14 15:22:36 -08:00
448c8c628c xds: replace eds proto message with xdsclient defined struct in eds balancer (#3174)
The xds client will parse the EDS response, and give the parse result to eds balancer, so the balancer doesn't need to deal with proto directly.

Also moved `ClusterLoadAssignmentBuilder` to another pacakge to be shared by tests in different packages.
2019-11-14 10:11:01 -08:00
0b3a5cc266 Move bootstrap functionality to a new package. (#3176) 2019-11-13 09:58:04 -08:00
2cb07fcd90 resolver: rename Option to Options, leaving type aliases for now (#3175) 2019-11-12 15:23:46 -08:00
dc9615bb06 xds: Initial implementation of a client using the v2 API (#3144)
This object will be used by a higher level xdsClient object, which will
provide the watch API used by the xds resolver and balancer
implementations.
2019-11-12 10:31:11 -08:00
460b1d2ced dns: disable SRV record lookups unless grpclb is imported (#3149) 2019-11-11 10:12:40 -08:00
51ac07fb67 vet: revise staticcheck strategy (#3152) 2019-11-08 14:46:57 -08:00
95c3759457 examples: change wait into job polling loop after killing tests (#3168) 2019-11-08 14:46:36 -08:00
d903dd74ec interop: add grpclb fallback test (#2994) 2019-11-08 13:14:23 -08:00
4717e3b570 resolver: add deprecation note to AddressType and its values (#3156) 2019-11-08 10:38:45 -08:00
f691f3524e resolver: re-add dns and passthrough packages as references to internal versions (#3162) 2019-11-08 09:53:51 -08:00
caaa764950 examples: enable debugging to help determine why tests are hanging (#3166) 2019-11-08 09:53:16 -08:00
6071e7015f more detailed log message (#3117) 2019-11-07 13:12:57 -08:00
c2b74f7468 xds: set client node.BuildVersion to gRPC version (#3140) 2019-11-07 09:59:00 -08:00
2548a2203d internal: fix EDS test race in cmp/sort (#3154) 2019-11-06 19:38:51 -08:00
0aa47d32da resolver: introduce attributes package and use it for Address and State (#3151) 2019-11-06 16:53:23 -08:00