Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/authorityverifyokhttp' into auth…
Browse files Browse the repository at this point in the history
…orityverifyokhttp
  • Loading branch information
kannanjgithub committed Dec 15, 2024
2 parents aa59965 + ece5487 commit 20fa07d
Show file tree
Hide file tree
Showing 75 changed files with 1,704 additions and 596 deletions.
25 changes: 11 additions & 14 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,16 @@ jobs:

bazel:
runs-on: ubuntu-latest
strategy:
matrix:
include:
# Test with and without bzlmod. Bazel 6 doesn't support bzlmod, so use Bazel 7 instead
- bazel: 6.0.0
bzlmod: false
- bazel: 7.0.0
bzlmod: true
env:
USE_BAZEL_VERSION: 6.0.0
USE_BAZEL_VERSION: ${{ matrix.bazel }}

steps:
- uses: actions/checkout@v4
Expand All @@ -97,19 +105,8 @@ jobs:
key: ${{ runner.os }}-bazel-${{ env.USE_BAZEL_VERSION }}-${{ hashFiles('WORKSPACE', 'repositories.bzl') }}

- name: Run bazel build
run: bazelisk build //... --enable_bzlmod=false
run: bazelisk build //... --enable_bzlmod=${{ matrix.bzlmod }}

- name: Run example bazel build
run: bazelisk build //... --enable_bzlmod=false
working-directory: ./examples

- name: Run bazel build (bzlmod)
env:
USE_BAZEL_VERSION: 7.0.0
run: bazelisk build //... --enable_bzlmod=true

- name: Run example bazel build (bzlmod)
env:
USE_BAZEL_VERSION: 7.0.0
run: bazelisk build //... --enable_bzlmod=true
run: bazelisk build //... --enable_bzlmod=${{ matrix.bzlmod }}
working-directory: ./examples
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module(
name = "grpc-java",
compatibility_level = 0,
repo_name = "io_grpc_grpc_java",
version = "1.69.0-SNAPSHOT", # CURRENT_GRPC_VERSION
version = "1.70.0-SNAPSHOT", # CURRENT_GRPC_VERSION
)

# GRPC_DEPS_START
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void of(Deadline expected) {
if (Math.abs(actualNanos - expectedNanos) > deltaNanos) {
failWithoutActual(
fact("expected", expectedNanos / NANOSECONDS_IN_A_SECOND),
fact("but was", expectedNanos / NANOSECONDS_IN_A_SECOND),
fact("but was", actualNanos / NANOSECONDS_IN_A_SECOND),
fact("outside tolerance in seconds", deltaNanos / NANOSECONDS_IN_A_SECOND));
}
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ subprojects {
apply plugin: "net.ltgt.errorprone"

group = "io.grpc"
version = "1.69.0-SNAPSHOT" // CURRENT_GRPC_VERSION
version = "1.70.0-SNAPSHOT" // CURRENT_GRPC_VERSION

repositories {
maven { // The google mirror is less flaky than mavenCentral()
Expand Down
17 changes: 17 additions & 0 deletions buildscripts/kokoro/psm-fallback.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Config file for internal CI

# Location of the continuous shell script in repository.
build_file: "grpc-java/buildscripts/kokoro/psm-interop-test-java.sh"
timeout_mins: 120

action {
define_artifacts {
regex: "artifacts/**/*sponge_log.xml"
regex: "artifacts/**/*.log"
strip_prefix: "artifacts"
}
}
env_vars {
key: "PSM_TEST_SUITE"
value: "fallback"
}
2 changes: 1 addition & 1 deletion compiler/src/test/golden/TestDeprecatedService.java.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import static io.grpc.MethodDescriptor.generateFullMethodName;
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.69.0-SNAPSHOT)",
value = "by gRPC proto compiler (version 1.70.0-SNAPSHOT)",
comments = "Source: grpc/testing/compiler/test.proto")
@io.grpc.stub.annotations.GrpcGenerated
@java.lang.Deprecated
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/test/golden/TestService.java.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import static io.grpc.MethodDescriptor.generateFullMethodName;
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.69.0-SNAPSHOT)",
value = "by gRPC proto compiler (version 1.70.0-SNAPSHOT)",
comments = "Source: grpc/testing/compiler/test.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class TestServiceGrpc {
Expand Down
26 changes: 12 additions & 14 deletions core/src/main/java/io/grpc/internal/DnsNameResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,21 +134,17 @@ public class DnsNameResolver extends NameResolver {
private final String host;
private final int port;

/** Executor that will be used if an Executor is not provide via {@link NameResolver.Args}. */
private final Resource<Executor> executorResource;
private final ObjectPool<Executor> executorPool;
private final long cacheTtlNanos;
private final SynchronizationContext syncContext;
private final ServiceConfigParser serviceConfigParser;

// Following fields must be accessed from syncContext
private final Stopwatch stopwatch;
protected boolean resolved;
private boolean shutdown;
private Executor executor;

/** True if using an executor resource that should be released after use. */
private final boolean usingExecutorResource;
private final ServiceConfigParser serviceConfigParser;

private boolean resolving;

// The field must be accessed from syncContext, although the methods on an Listener2 can be called
Expand All @@ -165,7 +161,7 @@ protected DnsNameResolver(
checkNotNull(args, "args");
// TODO: if a DNS server is provided as nsAuthority, use it.
// https://www.captechconsulting.com/blogs/accessing-the-dusty-corners-of-dns-with-java
this.executorResource = executorResource;

// Must prepend a "//" to the name when constructing a URI, otherwise it will be treated as an
// opaque URI, thus the authority and host of the resulted URI would be null.
URI nameUri = URI.create("//" + checkNotNull(name, "name"));
Expand All @@ -179,11 +175,15 @@ protected DnsNameResolver(
port = nameUri.getPort();
}
this.proxyDetector = checkNotNull(args.getProxyDetector(), "proxyDetector");
Executor offloadExecutor = args.getOffloadExecutor();
if (offloadExecutor != null) {
this.executorPool = new FixedObjectPool<>(offloadExecutor);
} else {
this.executorPool = SharedResourcePool.forResource(executorResource);
}
this.cacheTtlNanos = getNetworkAddressCacheTtlNanos(isAndroid);
this.stopwatch = checkNotNull(stopwatch, "stopwatch");
this.syncContext = checkNotNull(args.getSynchronizationContext(), "syncContext");
this.executor = args.getOffloadExecutor();
this.usingExecutorResource = executor == null;
this.serviceConfigParser = checkNotNull(args.getServiceConfigParser(), "serviceConfigParser");
}

Expand All @@ -200,9 +200,7 @@ protected String getHost() {
@Override
public void start(Listener2 listener) {
Preconditions.checkState(this.listener == null, "already started");
if (usingExecutorResource) {
executor = SharedResourceHolder.get(executorResource);
}
executor = executorPool.getObject();
this.listener = checkNotNull(listener, "listener");
resolve();
}
Expand Down Expand Up @@ -413,8 +411,8 @@ public void shutdown() {
return;
}
shutdown = true;
if (executor != null && usingExecutorResource) {
executor = SharedResourceHolder.release(executorResource, executor);
if (executor != null) {
executor = executorPool.returnObject(executor);
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/io/grpc/internal/GrpcUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public byte[] parseAsciiString(byte[] serialized) {

public static final Splitter ACCEPT_ENCODING_SPLITTER = Splitter.on(',').trimResults();

public static final String IMPLEMENTATION_VERSION = "1.69.0-SNAPSHOT"; // CURRENT_GRPC_VERSION
public static final String IMPLEMENTATION_VERSION = "1.70.0-SNAPSHOT"; // CURRENT_GRPC_VERSION

/**
* The default timeout in nanos for a keepalive ping request.
Expand Down
2 changes: 1 addition & 1 deletion examples/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bazel_dep(name = "googleapis", repo_name = "com_google_googleapis", version = "0.0.0-20240326-1c8d509c5")
bazel_dep(name = "grpc-java", repo_name = "io_grpc_grpc_java", version = "1.69.0-SNAPSHOT") # CURRENT_GRPC_VERSION
bazel_dep(name = "grpc-java", repo_name = "io_grpc_grpc_java", version = "1.70.0-SNAPSHOT") # CURRENT_GRPC_VERSION
bazel_dep(name = "grpc-proto", repo_name = "io_grpc_grpc_proto", version = "0.0.0-20240627-ec30f58")
bazel_dep(name = "protobuf", repo_name = "com_google_protobuf", version = "23.1")
bazel_dep(name = "rules_jvm_external", version = "6.0")
Expand Down
10 changes: 5 additions & 5 deletions examples/android/clientcache/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ android {
protobuf {
protoc { artifact = 'com.google.protobuf:protoc:3.25.1' }
plugins {
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
}
}
generateProtoTasks {
Expand All @@ -54,12 +54,12 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.0.0'

// You need to build grpc-java to obtain these libraries below.
implementation 'io.grpc:grpc-okhttp:1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-okhttp:1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'org.apache.tomcat:annotations-api:6.0.53'

testImplementation 'junit:junit:4.13.2'
testImplementation 'com.google.truth:truth:1.1.5'
testImplementation 'io.grpc:grpc-testing:1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
testImplementation 'io.grpc:grpc-testing:1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
}
8 changes: 4 additions & 4 deletions examples/android/helloworld/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ android {
protobuf {
protoc { artifact = 'com.google.protobuf:protoc:3.25.1' }
plugins {
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
}
}
generateProtoTasks {
Expand All @@ -52,8 +52,8 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.0.0'

// You need to build grpc-java to obtain these libraries below.
implementation 'io.grpc:grpc-okhttp:1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-okhttp:1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'org.apache.tomcat:annotations-api:6.0.53'
}
8 changes: 4 additions & 4 deletions examples/android/routeguide/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ android {
protobuf {
protoc { artifact = 'com.google.protobuf:protoc:3.25.1' }
plugins {
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
}
}
generateProtoTasks {
Expand All @@ -52,8 +52,8 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.0.0'

// You need to build grpc-java to obtain these libraries below.
implementation 'io.grpc:grpc-okhttp:1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-okhttp:1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'org.apache.tomcat:annotations-api:6.0.53'
}
8 changes: 4 additions & 4 deletions examples/android/strictmode/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ android {
protobuf {
protoc { artifact = 'com.google.protobuf:protoc:3.25.1' }
plugins {
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
}
}
generateProtoTasks {
Expand All @@ -53,8 +53,8 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.0.0'

// You need to build grpc-java to obtain these libraries below.
implementation 'io.grpc:grpc-okhttp:1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-okhttp:1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'org.apache.tomcat:annotations-api:6.0.53'
}
2 changes: 1 addition & 1 deletion examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ java {

// Feel free to delete the comment at the next line. It is just for safely
// updating the version in our release process.
def grpcVersion = '1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def protobufVersion = '3.25.5'
def protocVersion = protobufVersion

Expand Down
2 changes: 1 addition & 1 deletion examples/example-alts/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ java {

// Feel free to delete the comment at the next line. It is just for safely
// updating the version in our release process.
def grpcVersion = '1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def protocVersion = '3.25.5'

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion examples/example-debug/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ java {

// Feel free to delete the comment at the next line. It is just for safely
// updating the version in our release process.
def grpcVersion = '1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def protobufVersion = '3.25.5'

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions examples/example-debug/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<packaging>jar</packaging>
<!-- Feel free to delete the comment at the end of these lines. It is just
for safely updating the version in our release process. -->
<version>1.69.0-SNAPSHOT</version><!-- CURRENT_GRPC_VERSION -->
<version>1.70.0-SNAPSHOT</version><!-- CURRENT_GRPC_VERSION -->
<name>example-debug</name>
<url>https://github.com/grpc/grpc-java</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<grpc.version>1.69.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
<grpc.version>1.70.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
<protoc.version>3.25.5</protoc.version>
<!-- required for jdk9 -->
<maven.compiler.source>1.8</maven.compiler.source>
Expand Down
2 changes: 1 addition & 1 deletion examples/example-dualstack/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ java {

// Feel free to delete the comment at the next line. It is just for safely
// updating the version in our release process.
def grpcVersion = '1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def protobufVersion = '3.25.5'

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions examples/example-dualstack/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<packaging>jar</packaging>
<!-- Feel free to delete the comment at the end of these lines. It is just
for safely updating the version in our release process. -->
<version>1.69.0-SNAPSHOT</version><!-- CURRENT_GRPC_VERSION -->
<version>1.70.0-SNAPSHOT</version><!-- CURRENT_GRPC_VERSION -->
<name>example-dualstack</name>
<url>https://github.com/grpc/grpc-java</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<grpc.version>1.69.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
<grpc.version>1.70.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
<protoc.version>3.25.5</protoc.version>
<!-- required for jdk9 -->
<maven.compiler.source>1.8</maven.compiler.source>
Expand Down
2 changes: 1 addition & 1 deletion examples/example-gauth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ java {

// Feel free to delete the comment at the next line. It is just for safely
// updating the version in our release process.
def grpcVersion = '1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def protobufVersion = '3.25.5'
def protocVersion = protobufVersion

Expand Down
4 changes: 2 additions & 2 deletions examples/example-gauth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<packaging>jar</packaging>
<!-- Feel free to delete the comment at the end of these lines. It is just
for safely updating the version in our release process. -->
<version>1.69.0-SNAPSHOT</version><!-- CURRENT_GRPC_VERSION -->
<version>1.70.0-SNAPSHOT</version><!-- CURRENT_GRPC_VERSION -->
<name>example-gauth</name>
<url>https://github.com/grpc/grpc-java</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<grpc.version>1.69.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
<grpc.version>1.70.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
<protobuf.version>3.25.5</protobuf.version>
<!-- required for jdk9 -->
<maven.compiler.source>1.8</maven.compiler.source>
Expand Down
2 changes: 1 addition & 1 deletion examples/example-gcp-csm-observability/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ java {

// Feel free to delete the comment at the next line. It is just for safely
// updating the version in our release process.
def grpcVersion = '1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def protocVersion = '3.25.5'
def openTelemetryVersion = '1.40.0'
def openTelemetryPrometheusVersion = '1.40.0-alpha'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-gcp-observability/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ java {

// Feel free to delete the comment at the next line. It is just for safely
// updating the version in our release process.
def grpcVersion = '1.69.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.70.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def protocVersion = '3.25.5'

dependencies {
Expand Down
Loading

0 comments on commit 20fa07d

Please sign in to comment.