Commit Graph

4821 Commits

Author SHA1 Message Date
Eric Anderson 84dc5642bc Allow both old and new behavior from google-auth-library-java
google-auth-library-java:0.25.0 strips port and path parts in the
audience claim ("aud"). Updating the test to pass in both old
and new version of google-auth-library-java.

This commit does not upgrade google-auth-library-java because
it turned out that the upgrade involves the newer Guava version
(google-auth-library-java's dependency) failing with DexingNoClasspathTransform.
Details: https://github.com/grpc/grpc-java/pull/8078#issuecomment-821566805
It's technically possible to exclude the newer Guava, but it's a
good practice avoid excluding the newer version of a library.
2021-04-19 14:13:23 -07:00
Eric Anderson a81bf14f1f Upgrade to Guava 30.1, which warns on Java 7
This change can have large impact from two aspects:
1. It calls out a _large_ impact on the _few_ Java 7 users.
2. It may have _small_ impact on the _many_ Android users.

https://github.com/grpc/grpc-java/issues/4671 tracks gRPC's removal of
Java 7 support. We are quite eager to drop Java 7 support as that would
allow using new language features like default methods. Guava is also
dropping Java 7 support and starting in 30.1 it will warn when used on
Java 7. The purpose of the warning is to help discover users that are
negatively impacted by dropping Java 7 before it becomes a bigger
problem.

The Guava logging check was implemented in such a way that there is an
optional class that uses Java 8 bytecode. While the class is optional at
runtime, the Android build system notices when dexing and fails if
Java 8 language featutres are not enabled. We believe this will not be a
problem for most Android users, but they may need to add to their build:

```
android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}
```

See also https://github.com/google/guava/releases/tag/v30.1
2021-04-19 09:16:00 -07:00
Chengyuan Zhang bab1fe38dc
services: move classes with protobuf dependency into io.grpc.protobuf.services (#8056)
To separately manage services/classes with and without protobuf dependency in services package, we are moving classes with protobuf dependency into io.grpc.protobuf.services. This includes healthchecking, reflection, channelz, and binlogging.

Forwarding classes are created to avoid breaking existing users, while they are marked as deprecated to notify users to migrate.
2021-04-16 17:27:12 -07:00
ZHANG Dapeng eb6764841b
netty: fix status message when GOAWAY at MAX_CONCURRENT_STREAMS limit
Resolves #8097
2021-04-16 16:10:38 -07:00
ZHANG Dapeng 49f9380fc9
netty: fix StreamBufferingEncoder GOAWAY bug
Fix a bug in StreamBufferingEncoder: when client receives GOWAY while there are pending streams due to MAX_CONCURRENT_STREAMS, we see the following error:
io.netty.handler.codec.http2.Http2Exception$StreamException: Maximum active streams violated for this endpoint.
2021-04-16 14:23:14 -07:00
Chengyuan Zhang b4fe07d22d
xds: support ring_hash as the endpoint-level LB policy (#7991)
Update LB policy config generation to support ring hash policy as the endpoint-level LB policy.

- Changed the CDS LB policy to accept RING_HASH as the endpoint LB policy from CDS updates. This configuration is directly passed to its child policy (aka, ClusterResolverLoadBalancer) in its config.

- Changed ClusterResolverLoadBalancer to generate different LB configs for its downstream LB policies, depending on the endpoint-level LB policies.
  - If the endpoint-level LB policy is ROUND_ROBIN, the downstream LB policy hierarchy is: PriorityLB -> ClusterImplLB -> WeightedTargetLB -> RoundRobinLB
  - If the endpoin-level LB policy is RNIG_HASH, the downstream LB policy hierarchy is: PriorityLB -> ClusterImplLB -> RingHashLB.
2021-04-16 12:46:55 -07:00
Eric Anderson 31cfb6d32e
all: JacocoMerge must run after grpc-interop-testing's tests (#8093)
Otherwise the executionData would be out-of-date.
2021-04-16 11:10:04 -07:00
Chengyuan Zhang 9614738a7d
core, grpclb, xds: let leaf LB policies explicitly refresh name resolution when subchannel connection is broken (#8048)
Currently each subchannel implicitly refreshes the name resolution when its state changes to IDLE or TRANSIENT_FAILURE. That is, this feature is built into subchannel's internal implementation. Although it eliminates the burden of having LB implementations refreshing the resolver when connections to backends are broken, this is gives LB policies no chance to disable or override this refresh (e.g., in some complex load balancing hierarchy like xDS, LB policies may embed a resolver inside for resolving backends so the refreshing resolution operation should be hooked to the resolver embedded in the LB policy instead of the one in Channel).

In order to make this transition smoothly, we add a check to SubchannelImpl that checks if the LoadBalancer has explicitly called Helper.refreshNameResolution for broken subchannels created by it. If not, it logs a warning and do the refresh.

A temporary LoadBalancer.Helper API ignoreRefreshNameResolution() is added to avoid false-positive warnings for xDS that intentionally does not want a refresh. Once the migration is done, this should be deleted.
2021-04-16 10:49:06 -07:00
Eric Anderson 384f4c401d context: Add docs describing common Key usage
This recently came up in https://stackoverflow.com/a/67062503/4690866,
but it has come up multiple times before. These docs aren't ideal, as
they may be missed by a reader and so references in other parts of the
API would probably be appropriate. There could also be something about
"Context is not a general purpose map." But this is an improvement, and
I didn't want to let the perfect be the enemy of the good.
2021-04-16 09:36:16 -07:00
Tomo Suzuki 4ad49266ec OkHttpClientTransportTest's proxy to use localhost
Fixes #8080. The address 0.0.0.0 (that comes from new Socket(0).
.getLocalSocketAddress()) is for listening with a server, but it
is not meant to be used as the destination address as per
"3.2.1.3 Addressing" in RFC 1122
2021-04-15 10:57:54 -07:00
ZHANG Dapeng d25ebaf57d
core: fix NPE in ConfigSelectingClientCall
Fix the following bug:

ManagedChannelImpl.ConfigSelectingClientCall may return early in start() leaving delegate null, and fails request() method after start().

Currently the bug can only be triggered when using xDS.
2021-04-14 23:06:37 -07:00
Chengyuan Zhang d4fa0ecc07
xds: reduce the size of ring for testing pick distributions (#8079)
In the ring hash LB policy, building the ring is computationally heavy. Although using a larger ring can make the RPC distribution closer to the actual weights of hosts, it takes long time to finish the test.

Internally, each test class is expected to finish within 1 minute, while each of the test cases for testing pick distribution takes about 30 sec. By reducing the ring size by a factor of 10, the time spent for those test cases reduce to 1-2 seconds. Now we need larger tolerance for the distribution (three hosts with weights 1:10:100):

- With a ring size of 100000, the 10000 RPCs distribution is close to 91 : 866 : 9043
- With a ring size of 10000, the 10000 RPCs distribution is close to 104 : 808 : 9088

Roughly, this is still acceptable.
2021-04-12 14:55:31 -07:00
Sergii Tkachenko 278a336d1f buildscript: xds-k8s increase build timeout 2021-04-08 22:05:29 -04:00
Sergii Tkachenko c113ba1030 buildscript: add xds-k8s cluster endpoint override
Missed this in 1b86618ce9
2021-04-08 21:14:08 -04:00
Chengyuan Zhang 95adf96848
xds: implement ring_hash load balancing policy (#7943)
Implementation for the ring hash LB policy. A LoadBalancer that provides consistent hashing based load balancing to upstream hosts, with the "Ketama" hashing that maps hosts onto a circle (the "ring") by hashing its addresses. Each request is routed to a host by hashing some property of the request and finding the nearest corresponding host clockwise around the ring. Each host is placed on the ring some number of times proportional to its weight. With the ring partitioned appropriately, the addition or removal of one host from a set of N hosts will affect only 1/N requests.
2021-04-08 17:58:45 -07:00
Sergii Tkachenko 1b86618ce9 buildscript: use different xds-k8s cluster
In preparation to the Public Preview.
2021-04-08 19:00:34 -04:00
Sergii Tkachenko d971fe629c RELEASING.md: remove JCenter note
JFrog has announced that they are shutting down the JCenter: https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/
2021-04-08 14:03:33 -04:00
Sergii Tkachenko 1b996b171b Update README etc to reference 1.37.0 2021-04-08 12:34:06 -04:00
Sergii Tkachenko 6ad3f5d9e4 xds: Fix error prone UnnecessaryJavacSuppressWarnings in a test 2021-04-07 21:59:31 -04:00
Chengyuan Zhang b956f8852d
grpclb: include fallback reason in error status of failing to fallback (#8035)
Enhance error information reflected by RPC status when failing to fallback (aka, no fallback addresses provided by resolver), by including the original cause of entering fallback. Cases to fallback include:

  - When the fallback timer fires before we have received the first response from the balancer.
     - If no fallback addresses are found, RPCs will be failed with status {UNAVAILABLE, description="Unable to fallback, no fallback addresses found\n Timeout waiting for remote balancer", cause=null}
  - When the balancer RPC finishes before receiving any backend addresses
     - If no fallback addresses are found, RPCs will be failed with status {UNAVAILABLE, description="Unable to fallback, no fallback addresses found\n <description from the status of balancer RPC>", cause=<cause from the status of balancer RPC>}
  - When we get an explicit response from the balancer telling us go into fallback
     - If no fallback addresses are found, RPCs will be failed with status {UNAVAILABLE, description="Unable to fallback, no fallback addresses found\n Fallback requested by balancer", cause=null}
  - When the balancer call has finished *and* we cannot connect to any of the backends in the last response we received from the balancer.
     - Depending on whichever the two happened last, the last happening one is the reason that triggers entering fallback. If no fallback addresses are found, RPCs will be failed with status {UNAVAILABLE, description="Unable to fallback, no fallback addresses found\n <description from the status of balancer RPC>", cause=<cause from the status of balancer RPC>} or {UNAVAILABLE, description="Unable to fallback, no fallback addresses found\n <description from the status of one of the broken subchannels>", cause=<cause from the status of one of the broken subchannels>}

Note all RPCs will fail with UNAVAILABLE status code, the fallback reason will be attached as description and cause (if any).
2021-04-07 18:06:32 -07:00
Sergii Tkachenko 239db4b381 RELEASING.md: Add pre-tagging internal step 2021-04-07 16:36:58 -04:00
sanjaypujare 1a3b02b44b
xds: cache bootstrapInfo in the SslContextProviderFactory to prevent rereading (#8051) 2021-04-05 16:26:29 -07:00
Eric Anderson 5e9a7b6e2f
bom: Do not include grpc-binder (#8038)
Binder is not yet being published, so this artifact wouldn't exist.
2021-04-02 13:03:08 -07:00
sanjaypujare d9956a53df
xds: Fix validation of HCM filter and Router httpFilter (#8039)
* add 1 more check that works with TD now
2021-04-02 09:48:13 -07:00
Eric Anderson d8061c4ced netty: Add support for OpenJSSE
Tested with the interop client on Zulu 8 and Zulu 11 with
-XX:+UseOpenJSSE (after disabling tcnative). I was unable to add a new
case to TlsTest because adding OpenJSSE as a dependency in a Gradle
build fails: https://github.com/openjsse/openjsse/issues/19

Fixes #7907
2021-04-02 09:32:14 -07:00
sanjaypujare ac6461dfe5
xds: expose bootstrap through XdsClient interface (#8041) 2021-04-01 18:45:46 -07:00
markb74 9fc32f1bc9
binder: Add LeakSafeOneWayBinder and tests. (#8021)
Another util class, this one with tests which need to run on
an Android emulator.
2021-03-31 17:39:10 +01:00
Sergii Tkachenko 11c3667b8c interop-testing: xDS interop app uses AdminInterface 2021-03-30 21:23:19 -04:00
sanjaypujare 4896a0fee8
xds: move the state check logic to delegate and eliminate boilerplate code (#8018) 2021-03-25 16:52:15 -07:00
Sergii Tkachenko e4b292aa9b Start 1.38.0 development cycle 2021-03-25 18:49:03 -04:00
Sergii Tkachenko 828b03da27 xds: add CsdsService 2021-03-25 16:20:30 -04:00
Sergii Tkachenko b417b70db1 xds: add csds.proto (v3) with dependencies, generated code 2021-03-25 16:20:30 -04:00
Chengyuan Zhang ad2b26436c
xds: update (local) configurations atomically for each LDS/RDS resource update (#8011)
Fixes inconsistent state of XdsNameResolver with most recently received xDS configurations. The full suite of configurations should always be updated whenever receiving new resource updates, including updates that revoke currently in-use resources. Reference counts for currently in-use clusters should also be cleaned up properly. Otherwise, re-receiving (after being revoked) the same resource can be treated as if the configuration never changed.
2021-03-24 17:06:03 -07:00
ZHANG Dapeng ccedd85418
xds: enforce non-null overrideConfigs field for http filters 2021-03-24 17:05:17 -07:00
markb74 c6d48f7cb1
binder: Some basic binderchannel util code (#7796)
This just adds the ServiceBinding class and
BindServiceFlags, internal utils.

Most binderchannel code relies heavily on Java8 features,
so I'm keeping that requirement, since grpc-java plans to
require Java8 eventually anyway.
2021-03-24 15:40:11 -07:00
ZHANG Dapeng 3ccc6792d5
xds: enable circuit breaking, timeout, fault injection by default 2021-03-24 14:50:59 -07:00
sanjaypujare b7afbc30d1
xds: remove syncContext and just use the executorService (#8006) 2021-03-24 12:41:58 -07:00
sanjaypujare c4dec7517f
xds: add/enhance Javadoc comments for XdsServerBuilder. (#8007) 2021-03-23 10:53:21 -07:00
Eric Anderson 931d95d3f3 okhttp: Fix okio 2.x API incompatibility
okio 2.x is ABI compatible with 1.x but not API compatible. This hasn't
been a problem as users use binaries from Maven Central so the ABI
compatibility is the important part. However, when building with Bazel
the API compatibily is the important part.

Tested with okio 2.10.0

Fixes #8004
2021-03-22 17:55:54 -07:00
Sergii Tkachenko 8ff0b23c2e
xds: ADS parsing: collect parsing errors on NACK; cache resources on ACK 2021-03-22 20:34:03 -04:00
Chengyuan Zhang b2e475712d
alts: make both GoogleDefaultChannelCredentials and ComputeEngineChannelCredentials choose ALTS for backends given by xDS TD (#7999)
GoogleDefaultChannelCredentials and ComputeEngineChannelCredentials are literally the same thing for DirectPath, both of them should behave the same for choosing the protocol negotiator for talking to backends given by Traffic Director.
2021-03-19 17:01:05 -07:00
apolcyn ccd43b64e3
xds: enable v3 API in bootstrap generated by cloud-to-prod resolver (#7995) 2021-03-19 15:26:15 -07:00
apolcyn ab216a1720
interop-testing, xds: Allow using TestServiceClient for making Traffic Director RPCs (#7994)
Updates TestServiceClient to support creating channel without target port (mostly useful for xDS that uses the channel target as the resource name).

Adds an env var for overriding the TD URI used in cloud-to-prod test.
2021-03-19 12:44:52 -07:00
yifeizhuang 043c9d6407
xds: weightedTargetLB collect all failure child pickers to log more error details (#7989) 2021-03-18 17:39:48 -07:00
Chengyuan Zhang f0512db060
xds: delete redundant hash function configuration (#7950)
Initially we were about to support both xx_hash and murmur_hash. But later we decided to support xx_hash only. So for any hashing we are using in xDS, it's going to be xx_hash. Therefore, we do not need to define and carry this configuration around.
2021-03-18 11:48:25 -07:00
sanjaypujare a460f784c6
xds: fix filterChainMatch for multiple matchers, 0-length prefixLength and empty prefixRange list (#7985) 2021-03-18 10:22:35 -07:00
sanjaypujare cd3b0c4412
xds: clean up to remove the cert-instance-override related code (#7986) 2021-03-18 10:22:04 -07:00
Penn (Dapeng) Zhang e8d935e5c9 xds: pretty print http filters 2021-03-18 10:13:36 -07:00
Penn (Dapeng) Zhang 9950d30881 xds: import envoy router.proto 2021-03-18 10:13:36 -07:00
ZHANG Dapeng e4ccf0eeac
buildscript: enable fault injection interop test 2021-03-17 17:41:58 -07:00