Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A74 subclass move #11923

Draft
wants to merge 44 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
fd069e3
Framework definition to support A74
larry-safran Dec 4, 2024
b2cb05b
Test that update works (with associated fixes)
larry-safran Jan 6, 2025
8e668b5
Cleanup
larry-safran Jan 6, 2025
5b14a3e
Cleanup
larry-safran Jan 6, 2025
5f8d479
Add verification of data changing
larry-safran Jan 7, 2025
ec50490
Support aggregate clusters correctly
larry-safran Jan 7, 2025
5dceeaf
Fix class name referenced in javadoc
larry-safran Jan 7, 2025
fd64f20
Address a number of code review comments and add a test for missing C…
larry-safran Jan 8, 2025
b2e924e
Remove syncContext from watchers. Add checkNotNull, private and fina…
larry-safran Jan 8, 2025
5a75b10
Add a test for corrupt LDS
larry-safran Jan 8, 2025
d3b713f
Change aggregate cluster handling to correctly handle cluster names a…
larry-safran Jan 9, 2025
6089730
Errorprone
larry-safran Jan 9, 2025
d5dea83
Add max recursion limit for clusters to match c++.
larry-safran Jan 14, 2025
28d29fb
Fix handling of route and cluster updates.
larry-safran Jan 15, 2025
4a53fce
Make data private and XdsWatcherBase static
larry-safran Jan 15, 2025
c97118f
In LDS onChanged(), get old activeVirtualHost before possibly doing c…
larry-safran Jan 16, 2025
06466fc
Change comment for clarity
larry-safran Jan 16, 2025
b898e34
Allow EdsWatcher to have multiple CdsWatcher parents
larry-safran Jan 16, 2025
954ced3
Allow EdsWatcher to have multiple CdsWatcher parents
larry-safran Jan 16, 2025
ef13712
Fully support inlined RouteConfig
larry-safran Jan 17, 2025
518cef1
Add lots of `checkNotNull()`
larry-safran Jan 17, 2025
68071e6
Add test case testMultipleParentsInCdsTree, make a couple of cluster …
larry-safran Jan 18, 2025
f99fc56
Add test case testMultipleParentsInCdsTree, make a couple of cluster …
larry-safran Jan 18, 2025
482cd9d
Add virtual host to XdsConfig as per spec
larry-safran Jan 21, 2025
36602b6
Eliminate clusterSubscriptions and use objects directly instead of st…
larry-safran Feb 1, 2025
7042ed9
Add tests. Fix some places that were still using string instead of o…
larry-safran Feb 5, 2025
7ab45bb
core: Alternate ipV4 and ipV6 addresses for Happy Eyeballs in PickFir…
larry-safran Jan 14, 2025
f2701d9
interop-testing: fix peer extraction issue in soak test iterations
zbilun Jan 14, 2025
8b4391f
interop-testing: Move soak out of AbstractInteropTest
ejona86 Jan 14, 2025
42270da
stub: Eliminate invalid test cases where different threads were calli…
larry-safran Jan 15, 2025
ae0fa25
xds: Envoy proto sync to 2024-11-11 (#11816)
shivaspeaks Jan 17, 2025
bdf6987
compiler: Prepare for C++ protobuf using string_view
ejona86 Jan 15, 2025
31966be
Update README etc to reference 1.69.1
ejona86 Jan 16, 2025
d4e5064
xds: Rename grpc.xds.cluster to grpc.lb.backend_service
ejona86 Jan 18, 2025
27e32b1
xds: Fix fallback test FakeClock TSAN failure
ejona86 Jan 22, 2025
9efd2f2
xds: Include max concurrent request limit in the error status for con…
kannanjgithub Jan 23, 2025
e6503ff
Much progress in A74 using DependencyManager
larry-safran Jan 31, 2025
0ba5c84
Merge with master
larry-safran Feb 24, 2025
86ea936
Merge with master
larry-safran Feb 25, 2025
d72d674
Handle Logical DNS clusters
larry-safran Feb 27, 2025
5f4813d
don't publish if any logical dns clusters are still unresolved.
larry-safran Feb 27, 2025
7e32c0a
Fix tests and some underlying bugs
larry-safran Feb 28, 2025
3569db8
Fix tests and some underlying bugs
larry-safran Mar 1, 2025
9c896a2
Fix tests and some underlying bugs
larry-safran Mar 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge with master
larry-safran committed Feb 24, 2025
commit 0ba5c847c6d3904085dbc4be519669337b3b64c7
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -44,8 +44,8 @@ For a guided tour, take a look at the [quick start
guide](https://grpc.io/docs/languages/java/quickstart) or the more explanatory [gRPC
basics](https://grpc.io/docs/languages/java/basics).

The [examples](https://github.com/grpc/grpc-java/tree/v1.69.1/examples) and the
[Android example](https://github.com/grpc/grpc-java/tree/v1.69.1/examples/android)
The [examples](https://github.com/grpc/grpc-java/tree/v1.70.0/examples) and the
[Android example](https://github.com/grpc/grpc-java/tree/v1.70.0/examples/android)
are standalone projects that showcase the usage of gRPC.

Download
@@ -56,18 +56,18 @@ Download [the JARs][]. Or for Maven with non-Android, add to your `pom.xml`:
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty-shaded</artifactId>
<version>1.69.1</version>
<version>1.70.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>1.69.1</version>
<version>1.70.0</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>1.69.1</version>
<version>1.70.0</version>
</dependency>
<dependency> <!-- necessary for Java 9+ -->
<groupId>org.apache.tomcat</groupId>
@@ -79,18 +79,18 @@ Download [the JARs][]. Or for Maven with non-Android, add to your `pom.xml`:

Or for Gradle with non-Android, add to your dependencies:
```gradle
runtimeOnly 'io.grpc:grpc-netty-shaded:1.69.1'
implementation 'io.grpc:grpc-protobuf:1.69.1'
implementation 'io.grpc:grpc-stub:1.69.1'
runtimeOnly 'io.grpc:grpc-netty-shaded:1.70.0'
implementation 'io.grpc:grpc-protobuf:1.70.0'
implementation 'io.grpc:grpc-stub:1.70.0'
compileOnly 'org.apache.tomcat:annotations-api:6.0.53' // necessary for Java 9+
```

For Android client, use `grpc-okhttp` instead of `grpc-netty-shaded` and
`grpc-protobuf-lite` instead of `grpc-protobuf`:
```gradle
implementation 'io.grpc:grpc-okhttp:1.69.1'
implementation 'io.grpc:grpc-protobuf-lite:1.69.1'
implementation 'io.grpc:grpc-stub:1.69.1'
implementation 'io.grpc:grpc-okhttp:1.70.0'
implementation 'io.grpc:grpc-protobuf-lite:1.70.0'
implementation 'io.grpc:grpc-stub:1.70.0'
compileOnly 'org.apache.tomcat:annotations-api:6.0.53' // necessary for Java 9+
```

@@ -99,7 +99,7 @@ For [Bazel](https://bazel.build), you can either
(with the GAVs from above), or use `@io_grpc_grpc_java//api` et al (see below).

[the JARs]:
https://search.maven.org/search?q=g:io.grpc%20AND%20v:1.69.1
https://search.maven.org/search?q=g:io.grpc%20AND%20v:1.70.0

Development snapshots are available in [Sonatypes's snapshot
repository](https://oss.sonatype.org/content/repositories/snapshots/).
@@ -131,7 +131,7 @@ For protobuf-based codegen integrated with the Maven build system, you can use
<configuration>
<protocArtifact>com.google.protobuf:protoc:3.25.5:exe:${os.detected.classifier}</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.69.1:exe:${os.detected.classifier}</pluginArtifact>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.70.0:exe:${os.detected.classifier}</pluginArtifact>
</configuration>
<executions>
<execution>
@@ -161,7 +161,7 @@ protobuf {
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.69.1'
artifact = 'io.grpc:protoc-gen-grpc-java:1.70.0'
}
}
generateProtoTasks {
@@ -194,7 +194,7 @@ protobuf {
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.69.1'
artifact = 'io.grpc:protoc-gen-grpc-java:1.70.0'
}
}
generateProtoTasks {
25 changes: 15 additions & 10 deletions xds/src/main/java/io/grpc/xds/CdsLoadBalancer2.java
Original file line number Diff line number Diff line change
@@ -46,6 +46,7 @@
import io.grpc.xds.PriorityLoadBalancerProvider.PriorityLbConfig.PriorityChildConfig;
import io.grpc.xds.XdsClusterResource.CdsUpdate;
import io.grpc.xds.XdsClusterResource.CdsUpdate.ClusterType;
import io.grpc.xds.XdsConfig.XdsClusterConfig;
import io.grpc.xds.XdsEndpointResource.EdsUpdate;
import io.grpc.xds.client.Bootstrapper;
import io.grpc.xds.client.Locality;
@@ -1029,7 +1030,7 @@ final class CdsLbState {
private LoadBalancer childLb;

private CdsLbState(String rootCluster,
ImmutableMap<String, StatusOr<XdsConfig.XdsClusterConfig>> clusterConfigs,
ImmutableMap<String, StatusOr<XdsClusterConfig>> clusterConfigs,
String rootName) {
root = new ClusterStateDetails(rootName, clusterConfigs.get(rootName));
clusterStates.put(rootCluster, root);
@@ -1050,7 +1051,7 @@ private void shutdown() {

// If doesn't have children is a no-op
private void initializeChildren(ImmutableMap<String,
StatusOr<XdsConfig.XdsClusterConfig>> clusterConfigs, ClusterStateDetails curRoot) {
StatusOr<XdsClusterConfig>> clusterConfigs, ClusterStateDetails curRoot) {
if (curRoot.result == null) {
return;
}
@@ -1060,7 +1061,7 @@ private void initializeChildren(ImmutableMap<String,
}

for (String clusterName : childNames) {
StatusOr<XdsConfig.XdsClusterConfig> configStatusOr = clusterConfigs.get(clusterName);
StatusOr<XdsClusterConfig> configStatusOr = clusterConfigs.get(clusterName);
if (configStatusOr == null) {
logger.log(XdsLogLevel.DEBUG, "Child cluster %s of %s has no matching config",
clusterName, this.root.name);
@@ -1155,7 +1156,7 @@ private void handleClusterDiscovered() {
childLb = null;
}
Status unavailable = Status.UNAVAILABLE.withDescription(String.format(
"CDS error: found 0 leaf (logical DNS or EDS) clusters for root cluster " + root.name));
"CDS error: found 0 leaf (logical DNS or EDS) clusters for root cluster %s", root.name));
helper.updateBalancingState(
TRANSIENT_FAILURE, new FixedResultPicker(PickResult.withError(unavailable)));
return;
@@ -1233,17 +1234,21 @@ private final class ClusterStateDetails {
private EdsUpdate endpointConfig;
private Status error;

private ClusterStateDetails(String name, StatusOr<XdsConfig.XdsClusterConfig> configOr) {
private ClusterStateDetails(String name, StatusOr<XdsClusterConfig> configOr) {
this.name = name;
if (configOr.hasValue()) {
XdsConfig.XdsClusterConfig config = configOr.getValue();
XdsClusterConfig config = configOr.getValue();
this.result = config.getClusterResource();
this.isLeaf = result.clusterType() != ClusterType.AGGREGATE;
if (config.getEndpoint() != null) {
if (config.getEndpoint().hasValue()) {
endpointConfig = config.getEndpoint().getValue();
if (isLeaf && config.getChildren() != null) {
// We should only see leaf clusters here.
assert config.getChildren() instanceof XdsClusterConfig.EndpointConfig;
StatusOr<EdsUpdate> endpointConfigOr =
((XdsClusterConfig.EndpointConfig) config.getChildren()).getEndpoint();
if (endpointConfigOr.hasValue()) {
endpointConfig = endpointConfigOr.getValue();
} else {
this.error = config.getEndpoint().getStatus();
this.error = endpointConfigOr.getStatus();
this.result = null;
}
}
82 changes: 72 additions & 10 deletions xds/src/main/java/io/grpc/xds/XdsConfig.java
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@
import io.grpc.xds.XdsRouteConfigureResource.RdsUpdate;
import java.io.Closeable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

@@ -118,19 +119,17 @@ public XdsConfigBuilder toBuilder() {
static final class XdsClusterConfig {
private final String clusterName;
private final CdsUpdate clusterResource;
private final StatusOr<EdsUpdate> endpoint; //Will be null for non-EDS clusters
private final ClusterChild children; // holds details

XdsClusterConfig(String clusterName, CdsUpdate clusterResource,
StatusOr<EdsUpdate> endpoint) {
XdsClusterConfig(String clusterName, CdsUpdate clusterResource, ClusterChild details) {
this.clusterName = checkNotNull(clusterName, "clusterName");
this.clusterResource = checkNotNull(clusterResource, "clusterResource");
this.endpoint = endpoint;
this.children = checkNotNull(details, "details");
}

@Override
public int hashCode() {
int endpointHash = (endpoint != null) ? endpoint.hashCode() : 0;
return clusterName.hashCode() + clusterResource.hashCode() + endpointHash;
return clusterName.hashCode() + clusterResource.hashCode() + children.hashCode();
}

@Override
@@ -141,15 +140,16 @@ public boolean equals(Object obj) {
XdsClusterConfig o = (XdsClusterConfig) obj;
return Objects.equals(clusterName, o.clusterName)
&& Objects.equals(clusterResource, o.clusterResource)
&& Objects.equals(endpoint, o.endpoint);
&& Objects.equals(children, o.children);
}

@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("XdsClusterConfig{clusterName=").append(clusterName)
.append(", clusterResource=").append(clusterResource)
.append(", endpoint=").append(endpoint).append("}");
.append(", children={").append(children)
.append("}");
return builder.toString();
}

@@ -161,8 +161,69 @@ public CdsUpdate getClusterResource() {
return clusterResource;
}

public StatusOr<EdsUpdate> getEndpoint() {
return endpoint;
public ClusterChild getChildren() {
return children;
}

interface ClusterChild {}

/** Endpoint info for EDS and LOGICAL_DNS clusters. If there was an
* error, endpoints will be null and resolution_note will be set.
*/
static final class EndpointConfig implements ClusterChild {
private final StatusOr<EdsUpdate> endpoint;

public EndpointConfig(StatusOr<EdsUpdate> endpoint) {
this.endpoint = checkNotNull(endpoint, "endpoint");
}

@Override
public int hashCode() {
return endpoint.hashCode();
}

@Override
public boolean equals(Object obj) {
if (!(obj instanceof EndpointConfig)) {
return false;
}
return Objects.equals(endpoint, ((EndpointConfig)obj).endpoint);
}

public StatusOr<EdsUpdate> getEndpoint() {
return endpoint;
}

@Override
public String toString() {
if (endpoint.hasValue()) {
return "EndpointConfig{endpoint=" + endpoint.getValue() + "}";
} else {
return "EndpointConfig{error=" + endpoint.getStatus() + "}";
}
}
}

// The list of leaf clusters for an aggregate cluster.
static final class AggregateConfig implements ClusterChild {
private final List<String> leafNames;

public AggregateConfig(List<String> leafNames) {
this.leafNames = checkNotNull(leafNames, "leafNames");
}

@Override
public int hashCode() {
return leafNames.hashCode();
}

@Override
public boolean equals(Object obj) {
if (!(obj instanceof AggregateConfig)) {
return false;
}
return Objects.equals(leafNames, ((AggregateConfig) obj).leafNames);
}
}
}

@@ -196,6 +257,7 @@ XdsConfigBuilder setVirtualHost(VirtualHost virtualHost) {

XdsConfig build() {
checkNotNull(listener, "listener");
checkNotNull(route, "route");
return new XdsConfig(listener, route, clusters, virtualHost);
}
}
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.