Commit Graph

4559 Commits

Author SHA1 Message Date
sanjaypujare 0781d2ca75
xds: use 0.0.0.0 in the resource query for LDS (#7624) 2020-11-16 09:25:18 -08:00
Chengyuan Zhang a43ae54c59
xds: implement a global map for holding circuit breaker request counters (#7588)
Circuit breakers should be applied to clusters in the global scope. However, the LB hierarchy might cause the LB policy (currently EDS, but cluster_impl in the future) that applies circuit breaking to be duplicated. Also, for multi-channel cases, the circuit breaking threshold should still be shared across channels in the process.

This change creates a global map for accessing circuit breaking atomics that used to count the number of outstanding requests per global cluster basis. Atomics in the global map are held by WeakReferences so LB policies/Pickers/StreamTracers do not need to worry about counter's lifecycle and refcount.
2020-11-13 12:12:32 -08:00
Eric Anderson ddd5dea7e9 Migrate callers to ServerCredentials 2020-11-13 11:13:33 -08:00
Eric Anderson ed290cc78a alts: Add ServerCredentials 2020-11-13 11:13:33 -08:00
Eric Anderson edcc6854a6 netty: Add ServerCredentials 2020-11-13 11:13:33 -08:00
Eric Anderson 60319dad2d api: Add ServerCredentials 2020-11-13 11:13:33 -08:00
Chengyuan Zhang 76ad953c36
interop-testing: fix wrong semantics for RPC failure stats in xDS test client (#7618)
The proto field is named as num_failures but its comment is saying it is for number of RPCs that failed to record a remote peer. RPC failed == RPC failed to record a remote peer was true previously (so no existing tests should be affected by this changed) as server completed RPCs immediately. It is no longer true with server capability to keep the call open/delayed.

This change clarifies the proto definition for stats RPC. rpcs_by_peer is for recording RPCs succeeded and num_failures is for RPCs failed. RPCs in the flight when the stats call times out are not counted towards any of the stats.
2020-11-13 10:28:44 -08:00
sanjaypujare 2c935e3766
xds: implement new bootstrap config value for grpc-server-resource-id and use on server side (#7617) 2020-11-12 08:24:32 -08:00
Attila 8062b69a0a
all: update google auth libraries 2020-11-11 16:51:18 -08:00
Chengyuan Zhang bf191cb5ea
interop-testing: aggregate accumulated stats by RPC methods in xDS test client (#7603)
Update xDS interop test proto to aggregate accumulated stats based on RPC methods (mirroring 643e5bcd1e8db931cf76a3be19cd9bba223ee987 in C-core's change). Updated the xDS interop test client to support querying accumulated stats aggregated to RPC methods.
2020-11-10 23:58:09 -08:00
sanjaypujare fbc48a86fa
xds: replace static initializers with hardcoded registration of 3 cert providers (#7606) 2020-11-09 13:44:24 -08:00
sanjaypujare cffc07f5d8
xds: add File-watcher certificate provider (#7590) 2020-11-09 09:52:42 -08:00
susinmotion d154aa3328 Add a timeout to AltsHandshakerStub 2020-11-09 09:23:09 -08:00
Chengyuan Zhang beb3232c0a
xds: immediately update picker when circuit breakers/drop policies change (#7600)
Previously the EDS LB policies does not propagate an updated picker that uses the new circuit breaker threshold and drop policies when those values change. The result is new circuit breaker/drop policies are not dynamically applied to new RPCs unless subchannel state has changed. This change fixes this problem. Whenever the EDS LB policy receives an config update, the immediately updates the picker with corresponding circuit breakers and drop policies to the channel so that the channel is alway picking up the latest configuration.
2020-11-06 15:59:25 -08:00
James deBoer a589f520c1
netty: Improve an exception message with more context (#7593)
Adds the address we are attempting to bind to. This context is useful for tracking down errors in configuration.
2020-11-06 12:58:05 -08:00
Chengyuan Zhang 01e3832b42
interop-testing: fix bug of not completing client configure RPC in xDS test client (#7597) 2020-11-05 16:16:52 -08:00
Jan Tattermusch 26d8f9cfa2
LoadWorker: clarify the semantics of --server_port flag
The behavior is as follows:
59528d8efe/benchmarks/src/main/java/io/grpc/benchmarks/driver/LoadWorker.java (L136)
(ServerConfig.port takes precedence if set).

grpc-go's documentation is clearer:
02cd07d9bb/benchmark/worker/main.go (L44)
2020-11-05 10:05:32 -08:00
Chengyuan Zhang 10dc41af74
core: round robin should ignore name resolution error for channel state change when there are READY subchannels (#7595)
Round robin is keeping use of READY subchannels even if there is name resolution error. However, it moves Channel state to TRANSIENT_ERROR.

In hierarchical load balancers, the upstream LB policy may need to aggregate pickers from multiple downstream round_robin LB policy while filtering out non-ready subchannels. It cannot infer if the subchannel can be used just from the SubchannelPicker interface. It relies on the state that the round_robin intends to set channel to.

So the change is to match the readiness of the picker/subchannel with the state that round_robin tries to update. It will completely ignore name resolution error if there are READY subchannels.
2020-11-04 14:36:12 -08:00
Chengyuan Zhang 8020a735f9
xds: refactor XdsClient test to cover protocol version v2 and v3 (#7577)
This change refactors client side XdsClient's unit test. The main testing logic (test cases) will being the abstract class while the extended classes will be providing xDS version-specific services and messages. With this approach, we do not suffer from maintaining two copies of test logics in order to cover both v2 and v3 xDS protocols. So every time making changes to XdsClient's own logic, we only need to modify the corresponding test logic in the abstract class. Also, this approach could be sustainable for future xDS protocol version upgrades without necessity to re-implement test logics.
2020-11-04 13:47:27 -08:00
sanjaypujare d7764d7e32
xds: reorder processing of tlsContext to prioritize CertProviderInstance (#7592) 2020-11-04 12:57:20 -08:00
Sean C. Sullivan d52b359631 enable Gradle wrapper validation
https://blog.gradle.org/gradle-wrapper-checksum-verification-github-action
2020-11-03 10:53:29 -08:00
Chengyuan Zhang 8e04df99f3
interop-testing: support dynamic configuration and accumulated stats for xDS test client (#7549) 2020-11-03 10:33:41 -08:00
Chengyuan Zhang b2bf5fa7f5
interop-testing: support rpc keep-open for xDS test server (#7548) 2020-11-03 10:33:17 -08:00
Chengyuan Zhang 47d1488373
xds: implement xDS circuit breaking max_requests (#7517)
Implemented xDS circuit breaking for the maximum number of requests can be in-flight. The threshold is retrieved from CDS responses and is configured at the cluster level. It is implemented by wrapping the Picker spawned by EDS LB policy (which resolves endpoints for a single cluster) with stream-limiting logic. That is, when the picker is trying to create a new stream (aka, a new call), it is controlled by the number of open streams created by the current EDS LB policy. RPCs dropped by circuit breakers are recorded into total number of drops at cluster level and will be reported to TD via LRS.

In the future, multiple gRPC channels can be load balancing requests to the same (global) cluster. Those request should share the same quota for maximum number of requests can be in-flight. We will use a global counter for aggregating the number of currently-in-flight requests per cluster.
2020-11-02 14:24:22 -08:00
Chengyuan Zhang 7009c1a863
xds: only reschedule time for unresolved resources upon ADS stream restarts (#7582)
Since the xDS resource version info persists across ADS stream recreation so that the management server can choose to not send client resources that have already been sent previously (in the previous stream). The client should not consider previously received (resolved) resources not exist if it does not receive them on the new ADS stream. So initial resource fetch timers should only be scheduled for unresolved resources when the ADS stream is recreated.
2020-11-02 12:12:31 -08:00
Sergii Tkachenko bb6679eec7 Update README etc to reference 1.33.1 2020-11-02 14:21:41 -05:00
ST-DDT 566f16ea0b
api: Clarify expectations regarding ServerCall#close (#7580) 2020-11-02 11:13:36 -08:00
Chengyuan Zhang df9c2355b1
xds: import v2 version of aggregate.ClusterConfig proto (#7573) 2020-10-29 23:49:54 -07:00
Sergii Tkachenko e65f67d4a9 Add sergiitk to MAINTAINERS.md
Might be needed for https://issues.sonatype.org/browse/OSSRH-61680
2020-10-29 17:08:20 -04:00
Sergii Tkachenko d314c68126
Fix builders ABI backward compatibility broken in v1.33.0
* fix channel builders ABI backward compatibility broken in v1.33.0
* fix server builders ABI backward compatibility broken in v1.33.0
* makes ForwardingServerBuilder package-private
2020-10-29 12:06:37 -04:00
Eric Anderson 735b85fb33 netty: Differentiate GOAWAY closure status descriptions
With this, it will be clear if the RPC failed because the server didn't
use a double-GOAWAY or if it failed because of MAX_CONCURRENT_STREAMS or
if it was due to a local race. It also fixes the status code to be
UNAVAILABLE except for the RPCs included in the GOAWAY error (modulo the
Netty bug).

Fixes #5855
2020-10-29 09:04:37 -07:00
Chengyuan Zhang 59528d8efe
xds: delete XdsClientImpl2 (#7565) 2020-10-29 00:20:24 -07:00
ZHANG Dapeng 5111eca71b
rls: remove redundant request field in CachedRouteLookupResponse 2020-10-28 17:24:23 -07:00
ZHANG Dapeng 654f7c3dc6
core: fix floating-point number formatting Locale (#7473) 2020-10-28 17:23:57 -07:00
Chengyuan Zhang 80631db7a8
xds: create singleton XdsClient object (promote ClientXdsClient) (#7500)
Use a global factory to create a shared XdsClient object pool that can be used by multiple client channels. The object pool is thread-safe and holds a single XdsClient returning to each client channel. So at most one XdsClient instance will be created per process, and it is shared between client channels.
2020-10-28 13:50:33 -07:00
Chengyuan Zhang 34ef76704a
xds: use passed-in SynchronizationContext for load report client (#7560)
LoadReportClient is a subcomponent of XdsClient. Since the XdsClient uses a SynchronizationContext for synchronizing its operations, calls to LoadReportClient APIs should all from that SynchronizationContext. Hence, we can pass that SynchronizationContext into LoadReportClient to synchronize its RPC operations as well. This eliminates the synchronization needed by LoadReportClient itself.
2020-10-28 12:44:13 -07:00
Chengyuan Zhang 351d4b4d0f
xds: make stats objects thread-safe (#7555)
A LoadStatsStore instance is used for recording client stats for a global cluster. A single instance may be shared by multiple client channels. So it should be thread-safe.
2020-10-28 12:40:07 -07:00
Chengyuan Zhang cdf7876813
xds: use internal SynchronizationContext for XdsClient's synchronization (#7559)
Replace locks used inside XdsClient for its synchronization with a SynchronizationContext created by itself.
2020-10-28 10:41:16 -07:00
sanjaypujare 5fe83c3b23
xds: add a V2 test for CDS response with UpstreamTlsContext and fix the broken CDS response processing (#7562) 2020-10-27 18:22:56 -07:00
Chengyuan Zhang 90a3873a13
interop-testing: only need to count total number of succeeded RPCs for accumulated stats in xDS tests (#7561) 2020-10-27 16:09:16 -07:00
sanjaypujare 8520e06012
xds: re-add tests removed from a previous PR for v3 support (#7556) 2020-10-27 13:29:10 -07:00
sanjaypujare f24fd7cab7
xds: implement the new v3 and old fallback server xDS API (#7553) 2020-10-26 18:46:27 -07:00
Chengyuan Zhang 3395112b4f
xds: import v3 version of aggregate.ClusterConfig proto (#7554) 2020-10-26 17:36:05 -07:00
Chengyuan Zhang f367e0c673
xds: promote ServerXdsClient (#7550)
Replace XdsClientImpl2 in server side code with ServerXdsClient, which is the split implementation for server side only.
2020-10-24 02:28:43 -07:00
Chengyuan Zhang a26f8e00a6
xds: import envoy proto envoy/config/cluster/aggregate/v2alpha/cluster.proto (#7551) 2020-10-24 02:27:06 -07:00
Chengyuan Zhang 40191b2f81
xds: implement XdsClient thread-safety and synchronization for gRPC client (refactored XdsClient to client and server usages separately) (#7533)
Two major changes involved:

- Separated client and server side XdsClient code paths. Currently the single XdsClientImpl2 implementation runs separate code paths for client side and server side usages. Due to different implementation progress for client side and server side development, client and server implementations diverge in whether it supports multiple/removing watchers, response data cache, synchronization model, etc. It became cumbersome to put them together in a single class. The separation is effectively duplicating the XdsClientImpl2 class for client and server so that the two sides can develop independently. But we made this AbstractXdsClient to reuse some of the code, such as the logic for xDS RPC stream. More details can be found in go/separate-client-server-xds-client.

- Changes the synchronization model for the client side APIs. Multiple gRPC Channels will be sharing a single XdsClient instance. So the client side APIs need to be thread-safe. Also, the XdsClient needs to implement synchronization for API calls and xDS RPC callbacks without using a particular Channel's SynchronizationContext. This is done by using XdsClient's own lock.
2020-10-23 13:38:24 -07:00
sanjaypujare b6601ba273
xds: create a full xDS example with XDS Channel creds and server xDS options (#7535) 2020-10-23 08:38:27 -07:00
sanjaypujare 26a4ca38ec
xds: Rename to dynamic reloading cert provider. (#7547)
Co-authored-by: matthewstevenson88 <mattstev@google.com>
2020-10-22 12:57:43 -07:00
Eric Anderson 45b8b0eb60 netty: Abrupt GOAWAY should not cause INTERNAL status
The stream creation was failing because the stream id was disallowed:
Caused by: io.grpc.StatusRuntimeException: INTERNAL: http2 exception
	at io.grpc.Status.asRuntimeException(Status.java:533)
	at io.grpc.stub.ClientCalls$BlockingResponseStream.hasNext(ClientCalls.java:629)
	... 16 more
Caused by: io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2Exception$StreamException: Cannot create stream 222691 greater than Last-Stream-ID 222689 from GOAWAY.

The problem was introduced in 9ead606. Fixes #7357
2020-10-22 11:15:58 -05:00
Chengyuan Zhang f5c7f4e154
interop-testing: add proto definitions for xDS circuit breaking test (#7545) 2020-10-21 17:57:34 -07:00