Commit Graph

4545 Commits

Author SHA1 Message Date
Eric Anderson 38fe5d276f interop-testing: Remove redundant tearDown() in hook
The main() Thread will call tearDown() itself. It appears this
redundancy has existed since e813eaae2f, where the normal error handling
was enhanced at the same time as cleaning up resource management. The
cleanup should have made it obvious the hook was no longer needed, but
alas. Technically, it did originally provide a purpose if setup()
failed, but it would have been better to just move setup() into the
try-catch instead. Today it doesn't even provide that purpose.
2020-10-13 16:34:57 -05:00
ST-DDT b7355052c4
Add implementation note regarding server interceptors and thread locals 2020-10-13 13:11:16 -07:00
sanjaypujare b08ce410f8
xds: fix the transport-socket-name to match what control plane sends (#7508) 2020-10-12 14:47:47 -07:00
Chengyuan Zhang 46290ef900
xds: gate xDS timeout with env variable (#7504) 2020-10-12 14:13:02 -07:00
sanjaypujare f9b428ab40
xds: implement XdsChannelCredentials (#7497) 2020-10-09 09:21:39 -07:00
Chengyuan Zhang 7dbf6a2c1c
xds: clarify required and optional fields in config selector result (#7496) 2020-10-09 01:04:34 -07:00
Chengyuan Zhang df95acda2f
xds: eliminate target name dependency in XdsClient and LRS client (#7498) 2020-10-08 17:23:46 -07:00
Eric Anderson 0203256171 interop-testing: Avoid alts incompatibility with netty
alts requires netty-shaded, not netty.
2020-10-08 12:59:26 -05:00
Chengyuan Zhang 5c59fd2b1a
xds: delete ConfigWatcher API (#7494) 2020-10-08 10:15:00 -07:00
Chengyuan Zhang 18e7e2ddca
xds: promote XdsClientImpl2 (#7484)
Replace the old XdsClient implementation with the new one that supports watching multiple LDS/RDS resources separately.
2020-10-08 00:57:26 -07:00
Chengyuan Zhang 460ca75684
xds: migrate xDS resolver to use XdsClient APIs for watching individual LDS/RDS resources (#7469) 2020-10-07 23:33:41 -07:00
ZHANG Dapeng 6cdd537f0e
grpclb: enhance grpclb logging 2020-10-07 16:22:52 -07:00
ZHANG Dapeng cc5403c4c9
rls: allow defaultTarget in RouteLookupConfig unset
The `default_target` field can be unset per the [spec](http://go/grpc-rls-lb-policy-design)

Also fixed a synchronization bug (related to #7460) that `createOrGet()` should be guarded by lock.
2020-10-07 15:36:57 -07:00
ZHANG Dapeng f59cd0a599
rls: add logging for rls lb 2020-10-07 15:36:14 -07:00
Eric Anderson a547e23f5e Migrate users of ManagedChannelBuilder.{forTarget,forAddress} to ChannelCredentials 2020-10-07 13:58:37 -05:00
Eric Anderson 5a687e3da8 alts: Expose ChannelCredentials for the various negotiators
AltsChannelBuilder could be improved a bit more by removing the call to
InternalNettyChannelBuilder.setProtocolNegotiatorFactory. However, to do
that cleanest would require reworking how port is plumbed in
NettyChannelBuilder and potentially AbstractManagedChannelImplBuilder to
move getDefaultPort() to ProtocolNegotiator from ClientFactory. Saving
that for another day.
2020-10-07 13:58:37 -05:00
Eric Anderson e595779047 okhttp: Add ChannelCredentials 2020-10-07 13:58:37 -05:00
Eric Anderson 1ffde15471 netty: Add ChannelCredentials 2020-10-07 13:58:37 -05:00
Eric Anderson 5733cd481a core: Add ChannelCredentials 2020-10-07 13:58:37 -05:00
Eric Anderson c8a94d1059 api: Add ChannelCredentials 2020-10-07 13:58:37 -05:00
ZHANG Dapeng 9b73e2365d
Start 1.34.0 development cycle 2020-10-06 16:10:51 -07:00
Eric Anderson 0e0bcdfe2a repositories.bzl: Remove Maven repositories, in favor of maven_install
Manually specifying individual Maven artifacts is very verbose and
error-prone. It also does not properly handle transitive dependencies.
It greatly increases the amount of effort to update dependencies.

v1.27.0 introduced support for maven_install and encouraged users to
migrate. I fully expect some users haven't migrated, but it's not clear
that an additional 8 months would help much. Users that don't want to
use maven_install are still free to do so, but would need to maintain
the verbose repository list themselves.

At some point we may begin using the @maven workspace which would
require maven_install, but are not doing so now (except in the examples)
and don't have immediate plans to start.
2020-10-06 16:26:36 -05:00
Chengyuan Zhang 0913dd2769
xds: fix lint (#7487) 2020-10-06 13:51:33 -07:00
Eric Anderson cdeda50758 netty: Fix Javadoc for ShadingTest 2020-10-05 15:49:07 -05:00
Chengyuan Zhang 0f7fd289a3
xds: implement XdsClient APIs for watching LDS/RDS resources individually (#7470)
Add XdsClient implementation of watching LDS/RDS resources, replacing the ConfigWatcher API. This makes LDS/RDS/CDS/EDS resource watchers work similarly. This change also cleans up XdsClientImpl's tests.
2020-10-02 16:50:07 -07:00
Chengyuan Zhang 7032d4ccd7
xds: sync envoy proto to commit 1c27396b1f7e756ba79eed72b47f485d44da1d41 (#7480) 2020-10-02 14:26:25 -07:00
Chengyuan Zhang 594cc76292
xds: advertise send_all_clusters client feature in LRS requests (#7477) 2020-10-01 13:32:13 -07:00
Eric Anderson ec0d01d7a4 netty: TCP close during TLS handshake should be UNAVAILABLE
Normally the first exception/event experienced is the cause and is
followed by a stampede of ClosedChannelExceptions. In this case,
SslHandler is manufacturing a ClosedChannelException of its own and
propagating it _before_ the trigger event. This might be considered a
bug, but changing SslHandler's behavior would be very risky and almost
certainly break someone's code.

Fixes #7376
2020-10-01 15:12:53 -05:00
Eric Anderson 0cd56c29d6
stub: Only throw on cancellation for streaming responses
Unary are far more common than streaming, and we're throwing for unary even
though it doesn't help the service. Let's stop doing that. We also stop
throwing in onComplete() for all cases, because it doesn't help any service;
it doesn't stop the service's processing and isn't even all that informative
since the cancellation can happen even after onComplete() is called.
2020-10-01 13:10:30 -07:00
ZHANG Dapeng f6c2d221e2
rls: fix wrong synchronization for pickSubchannel()
`RlsPicker.pickSubchannel()` does not run in SynchronizationContext, but it calls `CachingRlsLbClient.get()` which assumed running in SynchronizationContext. Fixed by removing `synchronizationContext.throwIfNotInThisSynchronizationContext()`. `CachingRlsLbClient.get()` is actually thread-safe in the sense it's guarded by lock, and `DataCacheEntry`'s fields are final.

`ChildPolicyWrapper.picker` was not thread-safe. Fixed by making it volatile.

Changed the test a bit since the old test doesn't really test things well.
2020-09-30 15:31:09 -07:00
Eric Anderson 00e2d717a2 netty: BDP ping accounting should occur after flow control
It's hoped that this resolves the "too_many_pings" issue some users are
seeing that is worked around by GRPC_EXPERIMENTAL_AUTOFLOWCONTROL=false.
This change also avoids resetting the ping count for empty data frames
(which shouldn't really happen with gRPC).

The previous code failed to reset the ping count on HEADERS and
WINDOW_UPDATE. The code _appeared_ to have callbacks for WINDOW_UPDATE,
but was layered above the Http2Connection so was never called. Thus,
this version is much more aggressive then the previous version while
also addressing the correctness issue.
2020-09-28 17:23:12 -05:00
Eric Anderson 4c1bab9ed5 Prepare for JUnit 4.13
It deprecates ExpectedException and Assert.assertThat(T, org.hamcrest.Matcher).
Without Java 8 we don't want to migrate away from ExpectedException at
this time. We tend to prefer Truth over Hamcrest, so I swapped the one
instance of Assert.assertThat() to use Truth. With this change we get a
warning-less build with JUnit 4.13. We don't yet upgrade because we
still need to support JUnit 4.12 for some use-cases, but will be able to
upgrade to 4.13 soon when they upgrade.
2020-09-28 17:07:50 -05:00
Chengyuan Zhang 2adeff56fe
xds: refactor resource subscription implementation in XdsClient (#7458)
Introduce ResourceSubscriber for tracking the state of a single resource.

Every time newly subscribing to some resource, a corresponding ResourceSubscriber is created. Note it does not control the resource discovery RPCs. It is still the XdsClient that sends RPCs for with all subscribed resource names for each type. A ResourceSubscriber can have the following states:

  - When the initial resource fetch timer (respTimer) is pending, the resource is under discovery, the resource data is unknown. Even if the XdsClient receives a response not containing the corresponding resource, it does not mean the resource is absent. We still need to wait until a response containing the resource data coming or the timer being fired. The timer is scheduled when the ResourceSubscriber is created. So the XdsClient should always create the corresponding ResourceSubscriber when it starts to subscribe a new resource.

  - If the resource fetch timer is not pending, we must know the existence of the resource data. If data field is set, it is the most recently received resource data (aka, cached entry). Otherwise, absent field is set to true, indicating the resource does not exist. The exceptional case is when the ADS stream is closed and in the retry backoff period. During that period, respTimer is cancelled and the resource existence may or may not be known. Once the backoff finishes, the XdsClient will reschedule the respTimer when it recreates the ADS stream and re-request all the resources.

Watchers can be added to existing ResourceSubscribers. At the time the watcher is added, its callback will be invoked if we've already known the existence of the resource. Otherwise, the watcher will just sit there and wait data or absence to come in the future.
2020-09-28 13:43:41 -07:00
Chengyuan Zhang 950ec30247
xds: delete XdsClientImplV2Test (#7461)
Maintaining two copies of tests is counter-productive. Having the entire set of XdsClientImpl tests for covering v2 protocol usage is an overkill.
2020-09-28 09:59:39 -07:00
ZHANG Dapeng e4c3de6334
rls: fix RLS_DATA_KEY propagation in headers 2020-09-28 09:56:01 -07:00
Chengyuan Zhang 9cbea16ccc
xds: stop setting PROXYLESS_CLIENT_HOSTNAME node metadata in LRS requests (#7459)
The PROXYLESS_CLIENT_HOSTNAME node metadata was a temporary workaround for management server to not send back all backend services as load reporting clusters. Now the management server is able to use `send_all_clusters` field to let the client side decide the group of clusters it is reporting loads for. So this node metadata is no longer needed.
2020-09-25 17:50:25 -07:00
Ran 7ca6c02312
Revert "core: delay sending cancel request on client-side when deadline expires (#6328)" (#7457) 2020-09-25 10:38:21 -07:00
Chengyuan Zhang 10b960ea5d
xds: shut down EDS downstream LB policies when no usable endpoints received (#7452) 2020-09-24 15:08:05 -07:00
Chengyuan Zhang 2e411512be
xds: rename CDS/EDS resource watch interface (#7454) 2020-09-24 10:48:58 -07:00
Chengyuan Zhang 41ba242782
xds: delete old EdsLoadBalancer codepath (#7448) 2020-09-23 17:21:18 -07:00
Chengyuan Zhang f62742561d
xds: add toString() and delete unnecessary equals()/hashCode() for LB configs (#7451) 2020-09-23 17:06:55 -07:00
Chengyuan Zhang f055200566
xds: define individual LDS/RDS data watch interface (#7453) 2020-09-23 17:00:41 -07:00
sanjaypujare 147bee8142
xds: implement fallbackProtocolNegotiator for XdsChannelBuilder (#7438) 2020-09-23 10:35:02 -07:00
ZHANG Dapeng d5668b9ee1
core,xds: remove deprecated rawConfig field from PolicySelection 2020-09-22 18:30:54 -07:00
Chengyuan Zhang bc8c758a3c
xds: log raw response messages in sync context (#7441) 2020-09-22 17:28:45 -07:00
Chengyuan Zhang b434df25cd
xds: generate EDS LB config with hardcoded locality picking policy (#7443) 2020-09-22 16:08:41 -07:00
Sergii Tkachenko ef7846496c
core: Inline AbstractManagedChannelImplBuilder 2020-09-22 10:48:31 -04:00
Chengyuan Zhang a5ae55e984
xds: sync Envoy proto to commit fd28e42f31730f5ed6f13f52999692a4885dd312 (2020-09-15) (#7445)
Sync Envoy proto to commit fd28e42f31730f5ed6f13f52999692a4885dd312 (2020-09-15, internal Envoy import CL: cl/332279092). Suppressed warning for using listening_addresses in Node and added TODO for cleaning it up.
2020-09-21 18:16:28 -07:00
Chengyuan Zhang d333304a2b
xds: promote EdsLoadBalancer2 (#7444)
Effectively migrate to the new codepath of hierarchical LB policies.
2020-09-21 16:44:09 -07:00
Chengyuan Zhang da100e8e49
build, examples, README.md: Update protobuf gradle plugin version to 0.8.13 (#7355)
Updated protobuf gradle plugin version to 0.8.13. Fixed Android Kokoro's memory issue by forcing to use a new Gradle daemon for building the previous commit.
2020-09-21 10:42:06 -07:00