Commit Graph

5632 Commits

Author SHA1 Message Date
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
Eric Anderson 38311e8730 .github/workflows: Bump action major versions
Almost all of these major version bumps are because they upgraded to
Node 16, which requires a new minimum version of the Runner (which
matters for those maintaining their own runners). The main outlier is
lock-threads, which changed the names of its input parameters.
2022-10-21 10:25:10 -07:00
Sanjay Pujare 4cb090145b Update README etc to reference 1.50.2 2022-10-20 17:36:54 -07:00
yifeizhuang 7007d78b71
doc: improve java doc ManagedChannelOrphanWrapper (#9636) 2022-10-20 11:16:53 -07:00
yifeizhuang fa00094328
xds: fix javadoc warning (#9637) 2022-10-20 10:34:58 -07:00
Sergii Tkachenko 6f3c915267
Update README etc to reference 1.50.1 2022-10-19 11:20:08 -07:00
DNVindhya 13c2db1aa3
add period to service filter regular expression in logging config (#9631) 2022-10-19 11:07:41 -07:00
DNVindhya aeb90e3855
gcp-observability: updated config to public preview config (#9622) 2022-10-18 14:23:54 -07:00
DNVindhya 43942623fb
gcp-observability: update observability logging proto (#9608) 2022-10-17 22:47:54 -07:00
Terry Wilson e16f1436a9
xds: wrr_locality LB to use acceptResolvedAddresses() (#9625)
Part of a migration to move load balancers away from
handleResolvedAddresses().
2022-10-13 16:27:03 -07:00
Terry Wilson 3198195908
xds: weighted_target to use acceptResolvedAddresses() (#9624)
Part of a migration from handleResolvedAddresses().
2022-10-13 15:55:23 -07:00
Terry Wilson b873dc2a7b
xds: Priority LB to use acceptResolvedAddresses() (#9623)
Part of a migration to move load balancers away from
handleResolvedAddresses()
2022-10-13 15:51:14 -07:00
Terry Wilson 63f3787f86
xds: cluster_resolver to use acceptResolvedAddresses() (#9615)
Part of a wider migration to migrate load balancers away from
handleResolvedAddresses().
2022-10-13 13:27:51 -07:00
Eric Anderson 6904f88a7d Update README etc to reference 1.50.0 2022-10-13 07:50:08 -07:00
Eric Anderson 38ef8d22d4 services: Exclude io.grpc.protobuf.services.internal from javadoc 2022-10-12 09:42:20 -07:00
Eric Anderson 18602b74e1 COMPILING.md: Fix protobuf version number to 21.7
This is essentially a repeat of b118e00c, but for our compiling
documentation. Protobuf has two versions nowadays: 3.21.7 for Java and
21.7 for protobuf as a whole. For 21.1 they tagged it both as 21.1 and
3.21.1, but they didn't do that for 3.21.7.

Fixes #9582
2022-10-10 16:06:52 -07:00
Terry Wilson 458e06fafa
cds: ClusterImplLoadBalancer to use acceptResolvedAddresses() (#9571)
This is part of the API migration away from handleResolvedAddresses().
2022-10-10 15:55:57 -07:00