Commit Graph

3966 Commits

Author SHA1 Message Date
Chengyuan Zhang 1cefe851e1
Upgrade robolectric version to 4.3.1 (#6595) 2020-01-13 11:39:05 -08:00
sanjaypujare 04924d07b3
xds: implement alpnProtocols based on list from xDS (#6594) 2020-01-10 17:02:06 -08:00
Jihun Cho 641d74f34f
grpclb: support explicit fallback from LB (#6549) 2020-01-10 13:54:43 -08:00
Chengyuan Zhang e6d15a6d04
doc: add instruction for installing Android SDK in COMPILING.md (#6593) 2020-01-10 09:58:28 -08:00
sanjaypujare dba09163de
netty: remove 'grpc-exp' from the list of next-protocol-versions in ALPN (#6592) 2020-01-09 16:41:20 -08:00
sanjaypujare bee375f205
xds: suppress hostname check but keep trust check in the delegated X509TrustManagerImpl (#6589) 2020-01-09 16:40:43 -08:00
Eric Anderson 8cf0196548
Add Cronet to main build
Building now requires an Android SDK unless you specify
-PskipAndroid=true
2020-01-09 15:20:41 -08:00
sanjaypujare 6517ac8a61
xds: add support for static and combined validation context and enhanced loggging (#6586) 2020-01-08 16:41:16 -08:00
ZHANG Dapeng d03a746d02
xds: rename experimental_cds policy name to cds_experimental
Incorporating comment https://github.com/grpc/grpc-java/pull/6504#discussion_r363463413. Currently there is no cross-language resolver sending CDS config so there is no impact of the change.
2020-01-08 15:38:53 -08:00
Tomo Suzuki 75f6fd8f10 Upgrade error_prone_annotations to 2.3.4 2020-01-03 14:50:34 -08:00
Eric Anderson bcda439317 core: Simplify ServiceConfigUtil via utility methods
This should be functionally equivalent. More can be done, but wanted all the
changes to be "obvious" when reading them.
2020-01-02 11:17:21 -08:00
Eric Anderson c606519a5d bazel: Support maven_install
maven_install is strongly superior to previous forms of grabbing dependencies
from Maven as it computes the appropriate versions to use from the full
transitive dependencies of all libraries used by an application. It also has
much less boilerplate and includes dependencies with generated targets.

In the future we will drop the jvm_maven_import_external usages and require
maven_install, at which point we can swap to using the `@maven' repository and
no longer depend on compat_repositories.

Fixes #5359
2019-12-30 12:08:42 -08:00
Eric Anderson 6a5ee19695 examples: Suggest Bazel's http_repository instead of git_repository
http_repository is preferred by Bazel over git_repository.
2019-12-30 12:08:42 -08:00
Eric Anderson 69f9029c9a repositories.bzl: Remove omit* args in favor of existing_rule() check
Using existing_rule() is now the preferred way of avoiding re-defining
repositories. The function names were changed to match the name of the
repository they add. Normally we would inline all the functions, but that's
unnecessary churn since the repositories will mostly be replaced with
maven_install() in the future.
2019-12-30 12:08:42 -08:00
Graeme Morgan d3c77f2d87 all: Add suppressions for GuardedBy violations
This supports releasing a new version of GuardedBy which finds more mistakes than it used to.

Filed #6578 to try to clean up the suppressions.
2019-12-30 10:17:05 -08:00
ZhenLian 19805233ef netty: Add Executor When Creating SslContext
This PR is to add one more Executor parameter when creating the SslContext.
In Netty, we already have this implementation for passing Executor when creating SslContext: netty/netty#8847. This extra Executor is used to take some time-consuming tasks when doing SSL handshake. However, in current gRPC implementation, we are not using this API.

In this PR, the relevant changes are:

1. get the executorPool from ChannelBuilder or ServerBuilder

2. pass the executorPool all the way down to ClientTlsHandler

3. fill executorPool in when creating SslHandler
2019-12-30 08:33:16 -08:00
Eric Anderson dd8165b2a7 api: Add ExperimentalApi to Metadata.BinaryStreamMarshaller
This was missed in d1078591 and the API has not yet been released.
2019-12-27 13:33:46 -08:00
Jiangtao Li d82140cdbc
alts: change errr status to permission deny if alts context not found (#6562) 2019-12-27 12:41:51 -08:00
Tomo Suzuki f07b79b11d proto-google-common-protos:1.17.0 (#6572) 2019-12-27 11:55:05 -08:00
Kun Zhang d227520388 xds: fix lint warnings in test code (#6559) 2019-12-27 11:14:51 -08:00
Jihun Cho 90969b3471
core: make service config error handling optional implementation (#6564) 2019-12-26 15:07:20 -08:00
ZHANG Dapeng 6b04fc18f3
xds: rename XdsClientRef to XdsClientPool 2019-12-18 13:44:35 -08:00
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