Commit Graph

6548 Commits

Author SHA1 Message Date
Larry Safran 530cf905b1
xds:Fix test flakiness by adding a timeout to verify. (#9771)
* xds:Fix test flakiness by adding a timeout to verify.
* Add a note warning about multiple threads in the test.
2022-12-21 14:29:17 -08:00
Larry Safran fe19152108
Eds weight allowed between max signed and max unsigned int (#9765)
* Enforce individual weights and sum of weights not exceeding the max unsigned int value
2022-12-20 13:07:10 -08:00
Eric Anderson 7c73baa450 Revert "Move name resolution retry from managed channel to name resolver. (#9758)"
This reverts commit 43bc578f20. It breaks
API without stair-stepping and needs to be tweaked architecturally.
2022-12-20 08:35:31 -08:00
Eric Anderson f08300e0e3 bazel: Include `@Generated` dep for autovalue
Fixes #9755
2022-12-19 19:51:29 -05:00
Kun Zhang 6adae08597
test: fix internal ErrorProne failure (#9761) 2022-12-19 12:54:24 -08:00
Terry Wilson 43bc578f20
Move name resolution retry from managed channel to name resolver. (#9758)
This change has these main aspects to it:

1. Removal of any name resolution responsibility from ManagedChannelImpl
2. Creation of a new RetryScheduler to own generic retry logic
     - Can also be used outside the name resolution context
3. Creation of a new RetryingNameScheduler that can be used to wrap any
   polling name resolver to add retry capability
4. A new facility in NameResolver to allow implementations to notify
   listeners on the success of name resolution attempts
     - RetryingNameScheduler relies on this
2022-12-16 15:30:57 -08:00
Larry Safran 46ed02ed72
xds:Update logic to match A57 (#9745)
* xds:Change timer creation logic to wait until the adsStream is ready before creating the timer to mark resources absent.

* xds:When the ads stream is closed only send errors to subscribers that haven't yet gotten results to match spec.

* Use a blocking queue to avoid the 2-second sleep.
For some inexplicable reason the following call.verifyRequest fails only for the V2 test and only from command line not IDE unless there is some Thread.sleep, even if it is only 1-millis.
2022-12-15 14:54:35 -08:00
Larry Safran ccb5d945c0
Start 1.53.0 development cycle (#9757) 2022-12-14 18:07:57 -08:00
Greg e325dc9112
Replace ctx.host_configuration.host_path_separator with ctx.configuration.host_path_separator. (#9742)
Replace ctx.host_configuration.host_path_separator with ctx.configuration.host_path_separator.

This is because

1. we're removing ctx.host_configuration
2. host_path_separator's value doesn't depend on the configuration (the API is misleading by embedding it under ctx.configuration). So this is a no-op.

Internal ref cl/494008561.
2022-12-14 12:13:31 -08:00
yifeizhuang 2a0b86f7cd
binder: BinderInternal.setIBinder() is public static (#9743) 2022-12-09 15:21:47 -08:00
yifeizhuang 9b5ca70f85
doc: add fake control plane xds test comments (#9735) 2022-12-07 14:53:06 -08:00
yifeizhuang 786417085c
xds: Nack xds response when weighted cluster total weight sums zero (#9738) 2022-12-07 13:16:21 -08:00
Mohan Li bf0b92a963
Log xDS node ID with verbosity INFO (#9731)
Log xDS node ID so that we can better debug DirectPath issues.

b/260634412
2022-12-06 08:06:00 -08:00
Larry Safran e14cba0bae
Update clarifying comment per code review. (#9730) 2022-12-02 16:04:17 -08:00
Larry Safran 3e5fa7c5df
xds:Fix ConcurrentModificationException in PriorityLoadBalancer (#9728)
Fix ConcurrentModificationException in PriorityLoadBalancer by making copy of children values to iterate rather than directly using children in for loop.
2022-12-02 15:15:48 -08:00
Eric Anderson 79f4411d20 xds: Remove outdated comment about observing total weight
total_weight is deprecated and serves no value.
2022-12-02 15:09:21 -08:00
yifeizhuang c87fc05224
xds: remove retained resources logics for RDS and EDS resources (#9724)
We use state-of-the-world approach. For LDS/CDS, the control plane must return all resources that the client has subscribed to in each request. If some LDS/CDS resources are gone in a new update, their corresponding RDS/EDS resources names will be onAbsent(), unless there is cached data that is in use by other subscribers in other components. 
The motivations to remove this "retained resource" logic between resource types are:
1. Already handled by the subscribers, e.g. a CDS state would shut down its childLBs on new updates. XdsResolver for LdsUpdate would cancel all existing RDS subscriptions. Therefore the onAbsent() notification is effectively no-op.
2. Complexity.
2022-12-02 10:35:26 -08:00
Smilencer 9dac8cf352
examples: add name resolve and load balance (#9700) 2022-12-01 13:17:34 -08:00
cbianchi-7 e36275e951 Additional changes that were added post-submission of PR 9669 for promoting out of experimental status. 2022-12-01 12:39:55 -08:00
Eric Anderson dceb764385 api: Avoid initializing CallOptions.Builder fields that will be overwritten
The JIT probably cleans this up, but it is a bit confusing and needless.
2022-12-01 11:42:50 -08:00
Eric Anderson df974455ae binder: Remove unused imports 2022-12-01 11:41:57 -08:00
Eric Anderson b51cd9fd99
core: Replace AtomicInteger.updateAndGet with compareAndSet
updateAndGet is only available in API level 24+. It is unclear why
AnimalSniffer didn't detect this.

This was noticed when doing the import, but the Android CI has also been
failing because of it.
2022-12-01 11:09:40 -08:00
Terry Wilson 78415f55d3
xds: Include additional EAG attributes on updates (#9723)
ClusterImplLoadBalancer adds the ATTR_CLUSTER_NAME and
ATTR_SSL_CONTEXT_PROVIDER_SUPPLIER attributes to the EAG list when it
creates a new subchannel, but they are lost on subsequent address
updates. This change assures the attributes are also included on address
updates.
2022-12-01 09:37:10 -08:00
Larry Safran c145473756
Improve error message when deadline is exceeded, making it clear which deadline (Context or CallOptions) was exceeded and making the grammar clearer. (#9713) 2022-11-30 13:58:57 -08:00
cbianchi-7 d6aa0ea370
binder: Promote out of experimental status (#9669) 2022-11-30 10:37:32 -08:00
apolcyn a5f458a3a7
xds: Limit ring hash max size to 4K (#9709)
Implements grpc/proposal#338 for Java.
2022-11-29 14:02:48 -08:00
Terry Wilson 5cf54f3178
xds: Support localities in multiple priorities (#9683)
Additional logic to support for the same locality appearing under
multiple priorities.
2022-11-29 13:15:28 -08:00
Eric Anderson 548d3cac38 MAINTAINERS.md: Add Binder maintainers 2022-11-29 13:01:53 -08:00
markb74 241097c6e0
binder: Set default idle timeout to 60 seconds, and enable "strict lifecycle management". (#9486) 2022-11-29 09:57:25 +01:00
markb74 f082151fb5
binder: Ensure the security interceptor is always closest to the actual transport. (#9716) 2022-11-28 17:38:00 -08:00
Eric Anderson 58ba73205a README.md: Update support docs, OkHttp server, binder 2022-11-28 11:06:01 -08:00
Eric Anderson c80b587579
okhttp: Add missing server support for TLS ClientAuth (#9711) 2022-11-22 17:09:03 -08:00
yifeizhuang b593871801
core: fix RejectedExecutionException in Retriable Stream (#9626)
Add big negative integer to pending stream count when cancelled. The count is used to delay closing master listener until streams fully drained.
Increment pending stream count before creating one. The count is also used to indicate callExecutor is safe to be used. New stream will not be created if big negative number was added, i.e. stream cancelled. New stream is created if not cancelled, callExecutor is safe to be used, because cancel will be delayed.
Create new streams (retry, hedging) is moved to the main thread, before callExecutor calls drain.
Minor refactor the masterListener.close() scenario.
2022-11-22 13:04:06 -08:00
Larry Safran 159bb8c55b
test:Report the values that were compared rather than the underlying durat… (#9710)
* Report the values that were compared rather than the underlying durations that generated those values.

* Eliminate BigInteger to eliminate flakiness from possible class loading overhead.
2022-11-21 17:29:36 -08:00
Eric Anderson 806fb84a57 examples: Swap to Channel/ServerCredentials API
This makes it more obvious when plaintext vs TLS is being used and is
the preferred API.

I did not change the Google Auth example, because it is doing things a
weird way and changing it would be more invasive. I also didn't update
the Android examples.
2022-11-21 09:09:21 -08:00
Sergii Tkachenko 775d79b0eb Update README etc to reference 1.51.0 2022-11-17 13:22:25 -08:00
pandaapo 1b94f48dc8
api: Fix CallOptions to be properly `@Immutable` (#9689)
Although CallOptions is annotated by @Immutable, its fields are not
final. So it's not truly immutable, namely not safe for unsynchronized
publication.

This commit adds final to all fields of CallOptions. Using internal
builder class to keep flexibility of constructing CallOptions.

Fixes #9658
2022-11-17 13:11:27 -08:00
Justin Bassett 1241946c15 Always update the TagContext in filterContext()
This is a potential optimization, depending on the OpenCensus
implementation installed. Currently, the code checks TagContext equality
against the empty TagContext as an optimization to avoid updating the
Context, but checking equality may not be cheaper than updating the
Context. In particular, this condition is almost always true, because we
[update the parentCtx with an additional
tag](bacf18db8d/census/src/main/java/io/grpc/census/CensusStatsModule.java (L770-L774)).
It's only true when there is no OpenCensus implementation (i.e. some
kind of no-op implementation that ignores TagContexts) or when the empty
TagContext already has that tag set to the specific value which varies
depending on the RPC method.

For the default OpenCensus implementation, the equality check is
equality between two maps. Other implementations may require additional
work to determine equality.

Basically, we are trading off rarely avoiding updating the Context for
always doing at least a map equality or potentially even more depending
on the OpenCensus implementation in use. Given this, it makes sense to
just always update the Context.
2022-11-17 10:22:43 -08:00
Sergii Tkachenko 80cd7ec457
bazel: Migrate from `cfg = "host"` to `cfg = "exec"` (#9695)
This change migrates from `cfg = "host"` to `cfg = "exec"`.
This is a no-op cleanup: `cfg = "host"` is a deprecated alias
for `cfg = "exec"`.

Tested:

```
bazel build //grpclb:grpclb
bazel build //compiler:java_grpc_library_toolchain
bazel build //compiler:grpc_java_plugin
bazel build '//compiler:*'
```

Internal ref cl/487924699
2022-11-16 13:01:59 -08:00
RapperCL 096898a46e
ManagedChannelImpl.SubchannelImpl args check bug (#9651)
Previously it could trigger NPE without the string saying which argument
was null.
2022-11-10 16:15:13 -08:00
RapperCL b8f142c1e7 reduce redundant judgment 2022-11-10 14:27:43 -08:00
Sergii Tkachenko eb1e5a11c6 Start 1.52.0 development cycle 2022-11-07 11:56:25 -08:00
Eric Anderson a82ea0cb09 Fix jmh -PjmhIncludeSingleClass
I would have assumed a JMH plugin update renamed include to includes,
but I don't see a mention to it in the plugin changelog. Either it was
an undocumented rename, or devs just kept fixing it locally and not
fixing upstream. In either case, it works now.
2022-11-04 13:46:33 -07:00
Terry Wilson 0d44203bdc
xds: Delay priority LB updates from children (#9670)
If a child policy triggers an update to the parent priority policy
it will be ignored if an update is already in process.

This is the second attempt to make this change, the first one caused a
problem with the ring hash LB. A new test that uses actual control plane
and data plane servers is now included to prove the issue no longer
appears.
2022-11-04 09:17:17 -07:00
Terry Wilson ba182c3e02
core: round_robin to use acceptResolvedAddresses()
Switching to new API to allow eventual deprecation of
handleResolvedAddresses()
2022-11-03 12:40:05 -07:00
Terry Wilson c1d0e14799
xds: Fake control plane test setup code to Rules (#9666)
This extracts the startup and shutdown code for the control and data
plane server to reparate JUnit rules, which allows this logic to be
resued in other tests in a simple manner. Also makes the test easier to
read with the boiler plate init code removed.
2022-11-03 10:48:52 -07:00
Terry Wilson 39c264698d
xds: least_request LB to use acceptResolvedAddresses() (#9616)
This is part of a migration to move all LBs away from using
handleResolvedAddresses().
2022-11-02 16:29:32 -07:00
Terry Wilson a65ecef538
xds: ring_hash to use acceptResolvedAddresses() (#9617)
Part of a migration to move all LBs away from handleResolvedAddresses()
2022-11-02 16:28:31 -07:00
apolcyn a97db60fd7
c2p resolver: use federation if enabled via env var (#9660) 2022-10-28 06:02:55 -07:00
yifeizhuang 47ddfa4f20
okhttp: add maxConnectionAge and maxConnectionAgeGrace (#9649) 2022-10-21 12:06:26 -07:00