Commit Graph

3944 Commits

Author SHA1 Message Date
Eric Gribkoff 91853036e6
Update README etc to reference 1.26.0 (#6548) 2019-12-18 13:40:28 -08:00
Nathan H. Leung 9c9163d453 context: update javadoc for withValue(s) to indicate withValue can be chained (#6545) 2019-12-18 13:33:31 -08:00
Jiangtao Li 04e1c9d44a
alts: add client authorization util library (#6529)
* alts: add client authorization util library
2019-12-18 10:54:59 -08:00
Eric Anderson 274bf62e04 bazel: Fix renamed javalite target
This was missed from 2d592642a, because the select hid the failure.
2019-12-18 10:24:14 -08:00
Eric Anderson a4299eb6be bazel: Use https to download from Maven Central
central.maven.org shouldn't have been used in the first place as it isn't one
of the canonical URLs to Maven Central, but even more importantly we want to
use https. The previous URL will probably stop working January 15, 2020[1][2].

Fixes #6536

1. https://central.sonatype.org/articles/2019/Apr/30/http-access-to-repo1mavenorg-and-repomavenapacheorg-is-being-deprecated/
2. https://central.sonatype.org/articles/2019/Nov/15/non-canonical-urls-will-be-redirected-today/
2019-12-18 10:00:43 -08:00
sanjaypujare ead36d152a
xds: use UpstreamTlsContext from attrs (#6533) 2019-12-18 09:40:23 -08:00
Chengyuan Zhang 06d529669a
xds: do not log onError status if RPC stream was shutted down by client (#6541) 2019-12-18 09:01:29 -08:00
Kun Zhang 212da14200
netty: enable io.grpc.netty.useCustomAllocator by default (take 2) (#6528)
Since #6526 has resolved the memory leak, let's turn it back on.
2019-12-18 08:33:29 -08:00
Chengyuan Zhang 1d35508000
xds: integrate usage of XdsClient in XdsNameResolver (#6504)
Enables the full flow of xDS protocol in gRPC. An XdsClient instance is created in XdsNameResolver when trying to resolve the address for URI with "xds-experimental" scheme. XdsClient sends LDS/RDS request under the hood to discover service's cluster information for the target URI. The XdsNameResolver then returns a service config containing cluster information to the channel. A reference of the XdsClient instance is also passed to the channel within the ResolutionResult.
2019-12-18 00:46:05 -08:00
ZHANG Dapeng 4733b0b123
xds: fix logging message format bug again 2019-12-17 17:16:33 -08:00
Chengyuan Zhang 52d0c994e2
xds: temporarily allow policy.disable_overprovisioning flag to be not set in EDS responses (#6539) 2019-12-17 16:25:59 -08:00
Chengyuan Zhang 4cebea333a
xds: fix bug of not ignoring responses received after shutdown (#6535)
XdsClientImpl should ignore responses received after shutdown is called.
2019-12-17 16:25:30 -08:00
Elliotte Rusty Harold 21f7413b50 deps: update auth to 0.19.0 (#6537) 2019-12-17 16:19:48 -08:00
ZHANG Dapeng 7aaef4f9b6
xds: fix log format bug 2019-12-17 13:37:15 -08:00
ZHANG Dapeng 2b8f712a13
xds: allow publishing xds to maven local 2019-12-17 12:07:39 -08:00
Chengyuan Zhang 074cb73702
xds: eliminate unnecessary caching mechanism for RDS (#6510)
A gRPC channel will only ever be interested in a single Listener. So each RDS request will request for at most one resource. By design, server is required to always send back client's newly requested resources, so client will always receive the RDS resource (if exists) after the request was sent. Therefore, client does not need to cache anything.
2019-12-16 17:39:55 -08:00
Kun Zhang ada575dd24
netty: use singleton for the custom allocator. (#6526)
The allocator has a circular reference that prevents it from GC'ed,
thus causes memory leak if gRPC Channels are created and shutdown
(even cleanly) on a regular basis.

See https://github.com/netty/netty/issues/6891#issuecomment-457809308
and internal b/146074696.
2019-12-16 17:35:40 -08:00
Jihun Cho 16ba163291 stub: fix javadoc to indicate correct version(1.25.0 -> 1.26.0) 2019-12-16 17:08:04 -08:00
ST-DDT 2afe13487c api: Fix javadoc for ManagedChannelBuilder#forTarget(String)
The dns scheme is only the default scheme with grpc-java. Other
libraries could add more NameResolvers and thus change the default. For
compatibility reasons, the schema should therefore be specified
explicitly.
2019-12-16 15:51:53 -08:00
Chengyuan Zhang d007af18e6
xds: fix bug of concluding retry state without checking retry task status (#6519) 2019-12-16 10:43:24 -08:00
Ran f6544bf95c
core: delay sending cancel request on client-side when deadline expires (#6328) 2019-12-16 09:58:36 -08:00
Eric Anderson 4357f7f159 examples: Throw exception in test instead of printStackTrace
Throwing makes cleaner code and also is more helpful if the exception is ever
thrown, as the error will be more clear.
2019-12-16 08:11:51 -08:00
Dounan Shi 9e02cf089e Gracefully shutdown example servers (#6512) 2019-12-13 16:19:45 -08:00
Eric Anderson 1f64ac94a8 Revert "grpclb: shuffle pick first index"
This reverts commit 1949ebd7ef.

The shuffling should be handled by the grpclb server instead.
2019-12-13 13:20:51 -08:00
Kun Zhang c032e2ebf9
Revert "netty: enable io.grpc.netty.useCustomAllocator by default (#6459)" (#6517)
This reverts commit b0e00fd4ba.

It may cause leak of netty native buffers when creating and shutting
down Channels on a regular basis.
2019-12-13 10:48:53 -08:00
Chengyuan Zhang 5c239437a2
xds: add logging for requests sent by XdsClient (#6516) 2019-12-12 17:27:57 -08:00
markb74 d107859145 Support for lazily serialized values in Metadata.
First add a new a Metadata.BinaryStreamMarshaller interface which
serializes to/from instances of InputStream, and a corresponding
Key.of() factory method.

Values set with this type of key will be kept unserialized internally,
alongside a reference to the Marshaller. A new method
InternalMetadata.serializePartial(), returns values which are either
byte[] or InputStream, and allows transport-specific handling of
lazily-serialized values.

For the regular serialize() method, stream-marshalled values will be
converted to byte[] via an InputStreams.
2019-12-12 15:34:30 -08:00
ZHANG Dapeng 75b9fee2d1
xds: fix NPE in fallback mode in CDS flow
In CDS flow, fallback is not supported. The fallback_policy in XdsConfig is null, causing NPE. This PR fixes that bug.
2019-12-12 14:35:50 -08:00
Ran 7f2266bcad
xds: make XdsChannelFactory default instance a constant. (#6513) 2019-12-11 16:55:29 -08:00
Eric Anderson 9a646518cb
netty: NettyServer should close ProtocolNegotiator 2019-12-10 16:46:30 -08:00
Eric Anderson 9485003cf9 core: Release Channel resources before considering terminated 2019-12-10 16:23:38 -08:00
sanjaypujare 76af2c97ea
xds: set UpstreamTlsContext in Attributes (#6500) 2019-12-10 15:41:04 -08:00
ZHANG Dapeng d5eb61c968
xds: drop support for balancer_name in XdsConfig
The balancer_name field in XdsConfig is deprecated and from now on we ignore it and don't support it.
2019-12-10 13:59:10 -08:00
Chengyuan Zhang f70f73f16c
xds: integrate LRS into XdsClient (#6490)
This change integrates invocation of client side load reporting into XdsClient's implementation:

- Changed LRS client implementation based on LRS design changes. In the new design, first LRS request contains a single ClusterStats message with cluster_name set to the cluster (AKA, CDS cluster) that this LRS client is reporting loads for (no stats data in first request). Then server responses back the name of cluster service (AKA, EDS service) to report loads for.

- Implemented newly proposed LRS client API for adding/removing sources of load stats data.

- Implemented XdsClient APIs for initiating/stopping load reporting.
2019-12-09 23:47:31 -08:00
Chengyuan Zhang 942c1c6b5f
xds: fix bug of verifying xDS requests with ordered resource names
Use matcher that takes care of resource name ordering for comparing requests.
2019-12-09 16:39:26 -08:00
Eric Gribkoff e66ab4e63b
xds: update deprecated charset import (#6502) 2019-12-09 16:23:27 -08:00
Chengyuan Zhang 2de5b4e254
xds: move methods for building test xDS proto messages into a utility class (#6501)
Move helper methods for building xDS protobuf messages into a utility class for code sharing. Tests for gRPC components that use `XdsClient` instance may want to use these methods as well.
2019-12-09 12:59:00 -08:00
ZHANG Dapeng 718f0369cb
core: refactor GracefulSwitchLoadBalancer to switch based on LoadBalancer.Factory
`GracefulSwitchLoadBalancer` was doing switch based on `LoadBalancerProvider.getPolicyName()`. This turned out to be very awkward when I have to synthesize a policy name for the provider, and what I actually care about is the identity of the lb provider not necessarily the policy name.

Now `GracefulSwitchLoadBalancer` is doing switch based on identity of `LoadBalancer.Factory`, which is simpler.
2019-12-09 11:57:16 -08:00
Chengyuan Zhang d3d977d096
xds: extract channel creation out of XdsClient's implementation (#6494)
Introduce a `XdsChannelFactory` for gRPC components that instantiate `XdsClient` instances.
2019-12-08 19:10:12 -08:00
ZHANG Dapeng 30688a1eff
xds: remove xds balancer_name from resolved service config
`XdsNameResolver` will eventually send out a CDS config instead EDS config, but balancer_name should never be sent out from `XdsNameResolver` anyway.

This PR is mainly to unblock current staging test.
2019-12-06 14:36:31 -08:00
Liu sheng 470a4ab12d Add support for cross-compiling for aarch64 platform
This change modified the building scripts to support cross compile
grpc-java for aarch64 platform

For grpc/grpc-java#6364
2019-12-06 14:21:34 -08:00
sanjaypujare 3145ef0b7c
xds: implementation of file based plugin credential (#6485) 2019-12-06 10:27:51 -08:00
Chengyuan Zhang d168632f82
xds: support multiple xDS servers in bootstrap file (#6493)
Support bootstrap file containing multiple xDS servers, with each has its own server URI and channel credential options. Multiple xDS servers are provided in case of one not reachable. For now, we would only use the first one.

This change also formats JSON strings in bootstrap related tests and add several tests for parsing bootstrap JSON as completeness.

Implementation of XdsClient is changed to take in a list of xDS servers. But still, we only use the first one.
2019-12-05 16:45:28 -08:00
Tomo Suzuki 29638780ae build: Replaced outdated comments (#6492) 2019-12-05 13:53:51 -08:00
ZHANG Dapeng b739239e8d
xds: apply error handling for FallbackLb.handleResolvedAddresses
Apply the same error handling for `FallbackLb.handleResolvedAddresses()` as `LookasideLb` and `CdsLoadBalancer`.
2019-12-05 13:51:01 -08:00
Tomo Suzuki 80699f8be9 all: bump Animal-sniffer-annotation to 1.18 (#6488) 2019-12-05 13:15:59 -08:00
ZHANG Dapeng 9c2501f146
xds: add CdsLoadBalancer
- Contains `ClusterWatcher` implementation. On cluster update, `ClusterWatcherImpl` spawns an EDS child balancer if not created, then based on the ClusterUpdate data, it sends an edsConfig to the EDS child balancer.
- `CdsLoadBalancer` reads `XdsClientRef` and `CdsConfig` from `resolvedAddresses`. Base on `resolvedAddresses`, it register a `ClusterWatcherImpl` to `XdsClient`.
- For a different cluster resource name in CdsConfig when `handleResolvedAddresses()`, `CdsLoadBalancer` will gracefully switch to the new cluster.
2019-12-05 11:04:54 -08:00
ZHANG Dapeng b833aae615
xds: fix build
Fix build failure of 96da68bab3
https://travis-ci.org/grpc/grpc-java/builds/620854037?utm_source=github_status&utm_medium=notification
2019-12-04 16:00:06 -08:00
Chengyuan Zhang 96da68bab3
xds: modify LRS client interface (#6483)
Add two APIs to LoadReportClient interface:

- addLoadStatsStore(String, LoadStatsStore)

- removeLoadStatsStore(String)

Each LoadReportClient is responsible for reporting loads for a single cluster. But a gRPC client can spread loads to multiple EDS services per cluster, while loads for each EDS service should be aggregated separately.

With this change, starting a LoadReportClient only starts LRS RPC, the source of load data to be reported is added via addLoadStatsStore API.
2019-12-04 14:22:30 -08:00
sanjaypujare 5b837c4a59
xds: add UpstreamTlsContext to ClusterUpdate (#6481) 2019-12-04 13:18:42 -08:00