Compare commits

...

11 Commits

Author SHA1 Message Date
Eric Anderson fa5cfcd63c Bump version to 1.68.2 2024-11-27 16:08:03 -08:00
Eric Anderson 3782ba89a0 Update README etc to reference 1.68.2 2024-11-27 15:56:46 -08:00
Kannan J 1dac376256 okhttp: Use failing "source" for read bytes when sending GOAWAY due to insufficient thread pool size
Create `ClientFrameHandler` with failing source to be used in case of failed 2nd thread scheduling. Fixes NPE from https://github.com/grpc/grpc-java/pull/11503.
2024-11-27 15:53:47 -08:00
Yash Tibrewal e225c23552
[CSM] Use xds-enabled server and xds credentials in examples (#11706)
Backport #11706 to v1.68.x
2024-11-27 14:56:06 -08:00
Vindhya Ningegowda 197a15c9c9
gae-interop-testing: Upgrade to Java 17 (#11710)
Java 11 is out-of-support on GAE. Unfortunately the docs use the term
"deprecated" as "deleted," not "discouraged." So they talk about it
being deprecated _after_ it is no longer supported.

https://cloud.google.com/appengine/docs/standard/lifecycle/support-schedule#java
https://cloud.google.com/appengine/docs/flexible/lifecycle/support-schedule#java

Backport of #11699
2024-11-26 17:26:52 -08:00
Kannan J 2636d5dda0
api: When forwarding from Listener onAddresses to Listener2 continue to use onResult (#11666) (#11688)
When forwarding from Listener onAddresses to Listener2 continue to use onResult and not onResult2 because the latter requires to be called from within synchronization context and it breaks existing code that didn't need to do so when using the old Listener interface.
2024-11-14 22:04:10 +05:30
Eric Anderson 468b29cb35 Bump version to 1.68.2-SNAPSHOT 2024-10-28 16:30:39 -07:00
Eric Anderson 16f93c8127 Bump version to 1.68.1 2024-10-28 16:22:10 -07:00
Eric Anderson 2b533529df Update README etc to reference 1.68.1 2024-10-28 16:11:16 -07:00
Eric Anderson 135f433bcd
Revert "stub: Ignore unary response on server if status is not OK" (#11636) (#11640)
This reverts commit 99f86835ed.

The change doesn't handle `null` messages, which don't happen with
protobuf, but can happen with other marshallers, especially in tests.
See cl/689445172

This will reopen #5969.
2024-10-28 09:59:45 +05:30
Eric Anderson 2d0c158987
Bump to 1.68.1-SNAPSHOT (#11637)
1.68.0 has already been used (by a mistaken 1.67.x release)
2024-10-25 12:20:26 +05:30
42 changed files with 113 additions and 172 deletions

View File

@ -2,7 +2,7 @@ module(
name = "grpc-java",
compatibility_level = 0,
repo_name = "io_grpc_grpc_java",
version = "1.68.0-SNAPSHOT", # CURRENT_GRPC_VERSION
version = "1.68.2", # CURRENT_GRPC_VERSION
)
# GRPC_DEPS_START

View File

@ -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.67.1/examples) and the
[Android example](https://github.com/grpc/grpc-java/tree/v1.67.1/examples/android)
The [examples](https://github.com/grpc/grpc-java/tree/v1.68.2/examples) and the
[Android example](https://github.com/grpc/grpc-java/tree/v1.68.2/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.67.1</version>
<version>1.68.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>1.67.1</version>
<version>1.68.2</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>1.67.1</version>
<version>1.68.2</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.67.1'
implementation 'io.grpc:grpc-protobuf:1.67.1'
implementation 'io.grpc:grpc-stub:1.67.1'
runtimeOnly 'io.grpc:grpc-netty-shaded:1.68.2'
implementation 'io.grpc:grpc-protobuf:1.68.2'
implementation 'io.grpc:grpc-stub:1.68.2'
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.67.1'
implementation 'io.grpc:grpc-protobuf-lite:1.67.1'
implementation 'io.grpc:grpc-stub:1.67.1'
implementation 'io.grpc:grpc-okhttp:1.68.2'
implementation 'io.grpc:grpc-protobuf-lite:1.68.2'
implementation 'io.grpc:grpc-stub:1.68.2'
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.67.1
https://search.maven.org/search?q=g:io.grpc%20AND%20v:1.68.2
Development snapshots are available in [Sonatypes's snapshot
repository](https://oss.sonatype.org/content/repositories/snapshots/).
@ -129,9 +129,9 @@ For protobuf-based codegen integrated with the Maven build system, you can use
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.6.1</version>
<configuration>
<protocArtifact>com.google.protobuf:protoc:3.25.3:exe:${os.detected.classifier}</protocArtifact>
<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.67.1:exe:${os.detected.classifier}</pluginArtifact>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.68.2:exe:${os.detected.classifier}</pluginArtifact>
</configuration>
<executions>
<execution>
@ -157,11 +157,11 @@ plugins {
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.25.3"
artifact = "com.google.protobuf:protoc:3.25.5"
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.67.1'
artifact = 'io.grpc:protoc-gen-grpc-java:1.68.2'
}
}
generateProtoTasks {
@ -190,11 +190,11 @@ plugins {
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.25.3"
artifact = "com.google.protobuf:protoc:3.25.5"
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.67.1'
artifact = 'io.grpc:protoc-gen-grpc-java:1.68.2'
}
}
generateProtoTasks {

View File

@ -219,13 +219,15 @@ public abstract class NameResolver {
@Override
@Deprecated
@InlineMe(
replacement = "this.onResult2(ResolutionResult.newBuilder().setAddressesOrError("
replacement = "this.onResult(ResolutionResult.newBuilder().setAddressesOrError("
+ "StatusOr.fromValue(servers)).setAttributes(attributes).build())",
imports = {"io.grpc.NameResolver.ResolutionResult", "io.grpc.StatusOr"})
public final void onAddresses(
List<EquivalentAddressGroup> servers, @ResolutionResultAttr Attributes attributes) {
// TODO(jihuncho) need to promote Listener2 if we want to use ConfigOrError
onResult2(
// Calling onResult and not onResult2 because onResult2 can only be called from a
// synchronization context.
onResult(
ResolutionResult.newBuilder().setAddressesOrError(
StatusOr.fromValue(servers)).setAttributes(attributes).build());
}

View File

@ -21,7 +21,7 @@ subprojects {
apply plugin: "net.ltgt.errorprone"
group = "io.grpc"
version = "1.68.0-SNAPSHOT" // CURRENT_GRPC_VERSION
version = "1.68.2" // CURRENT_GRPC_VERSION
repositories {
maven { // The google mirror is less flaky than mavenCentral()

View File

@ -8,7 +8,7 @@ import static io.grpc.MethodDescriptor.generateFullMethodName;
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.68.0-SNAPSHOT)",
value = "by gRPC proto compiler (version 1.68.2)",
comments = "Source: grpc/testing/compiler/test.proto")
@io.grpc.stub.annotations.GrpcGenerated
@java.lang.Deprecated

View File

@ -8,7 +8,7 @@ import static io.grpc.MethodDescriptor.generateFullMethodName;
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.68.0-SNAPSHOT)",
value = "by gRPC proto compiler (version 1.68.2)",
comments = "Source: grpc/testing/compiler/test.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class TestServiceGrpc {

View File

@ -219,7 +219,7 @@ public final class GrpcUtil {
public static final Splitter ACCEPT_ENCODING_SPLITTER = Splitter.on(',').trimResults();
public static final String IMPLEMENTATION_VERSION = "1.68.0-SNAPSHOT"; // CURRENT_GRPC_VERSION
public static final String IMPLEMENTATION_VERSION = "1.68.2"; // CURRENT_GRPC_VERSION
/**
* The default timeout in nanos for a keepalive ping request.

View File

@ -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.66.0-SNAPSHOT") # CURRENT_GRPC_VERSION
bazel_dep(name = "grpc-java", repo_name = "io_grpc_grpc_java", version = "1.68.2") # 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")

View File

@ -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.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.68.2' // CURRENT_GRPC_VERSION
}
}
generateProtoTasks {
@ -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.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-okhttp:1.68.2' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.68.2' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.68.2' // 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.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
testImplementation 'io.grpc:grpc-testing:1.68.2' // CURRENT_GRPC_VERSION
}

View File

@ -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.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.68.2' // CURRENT_GRPC_VERSION
}
}
generateProtoTasks {
@ -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.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-okhttp:1.68.2' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.68.2' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.68.2' // CURRENT_GRPC_VERSION
implementation 'org.apache.tomcat:annotations-api:6.0.53'
}

View File

@ -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.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.68.2' // CURRENT_GRPC_VERSION
}
}
generateProtoTasks {
@ -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.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-okhttp:1.68.2' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.68.2' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.68.2' // CURRENT_GRPC_VERSION
implementation 'org.apache.tomcat:annotations-api:6.0.53'
}

View File

@ -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.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.68.2' // CURRENT_GRPC_VERSION
}
}
generateProtoTasks {
@ -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.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-okhttp:1.68.2' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.68.2' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.68.2' // CURRENT_GRPC_VERSION
implementation 'org.apache.tomcat:annotations-api:6.0.53'
}

View File

@ -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.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.68.2' // CURRENT_GRPC_VERSION
def protobufVersion = '3.25.5'
def protocVersion = protobufVersion

View File

@ -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.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.68.2' // CURRENT_GRPC_VERSION
def protocVersion = '3.25.5'
dependencies {

View File

@ -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.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.68.2' // CURRENT_GRPC_VERSION
def protobufVersion = '3.25.5'
dependencies {

View File

@ -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.68.0-SNAPSHOT</version><!-- CURRENT_GRPC_VERSION -->
<version>1.68.2</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.68.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
<grpc.version>1.68.2</grpc.version><!-- CURRENT_GRPC_VERSION -->
<protoc.version>3.25.5</protoc.version>
<!-- required for jdk9 -->
<maven.compiler.source>1.8</maven.compiler.source>

View File

@ -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.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.68.2' // CURRENT_GRPC_VERSION
def protobufVersion = '3.25.5'
dependencies {

View File

@ -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.68.0-SNAPSHOT</version><!-- CURRENT_GRPC_VERSION -->
<version>1.68.2</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.68.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
<grpc.version>1.68.2</grpc.version><!-- CURRENT_GRPC_VERSION -->
<protoc.version>3.25.5</protoc.version>
<!-- required for jdk9 -->
<maven.compiler.source>1.8</maven.compiler.source>

View File

@ -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.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.68.2' // CURRENT_GRPC_VERSION
def protobufVersion = '3.25.5'
def protocVersion = protobufVersion

View File

@ -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.68.0-SNAPSHOT</version><!-- CURRENT_GRPC_VERSION -->
<version>1.68.2</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.68.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
<grpc.version>1.68.2</grpc.version><!-- CURRENT_GRPC_VERSION -->
<protobuf.version>3.25.5</protobuf.version>
<!-- required for jdk9 -->
<maven.compiler.source>1.8</maven.compiler.source>

View File

@ -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.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.68.2' // CURRENT_GRPC_VERSION
def protocVersion = '3.25.5'
def openTelemetryVersion = '1.40.0'
def openTelemetryPrometheusVersion = '1.40.0-alpha'
@ -34,6 +34,7 @@ dependencies {
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
implementation "io.grpc:grpc-gcp-csm-observability:${grpcVersion}"
implementation "io.grpc:grpc-xds:${grpcVersion}"
implementation "io.opentelemetry:opentelemetry-sdk:${openTelemetryVersion}"
implementation "io.opentelemetry:opentelemetry-sdk-metrics:${openTelemetryVersion}"
implementation "io.opentelemetry:opentelemetry-exporter-prometheus:${openTelemetryPrometheusVersion}"

View File

@ -25,6 +25,7 @@ import io.grpc.examples.helloworld.GreeterGrpc;
import io.grpc.examples.helloworld.HelloReply;
import io.grpc.examples.helloworld.HelloRequest;
import io.grpc.gcp.csm.observability.CsmObservability;
import io.grpc.xds.XdsChannelCredentials;
import io.opentelemetry.exporter.prometheus.PrometheusHttpServer;
import io.opentelemetry.sdk.OpenTelemetrySdk;
import io.opentelemetry.sdk.metrics.SdkMeterProvider;
@ -127,8 +128,10 @@ public class CsmObservabilityClient {
observability.registerGlobal();
// Create a communication channel to the server, known as a Channel.
ManagedChannel channel = Grpc.newChannelBuilder(target, InsecureChannelCredentials.create())
.build();
ManagedChannel channel =
Grpc.newChannelBuilder(
target, XdsChannelCredentials.create(InsecureChannelCredentials.create()))
.build();
CsmObservabilityClient client = new CsmObservabilityClient(channel);
try {

View File

@ -24,6 +24,8 @@ import io.grpc.examples.helloworld.HelloReply;
import io.grpc.examples.helloworld.HelloRequest;
import io.grpc.gcp.csm.observability.CsmObservability;
import io.grpc.stub.StreamObserver;
import io.grpc.xds.XdsServerBuilder;
import io.grpc.xds.XdsServerCredentials;
import io.opentelemetry.exporter.prometheus.PrometheusHttpServer;
import io.opentelemetry.sdk.OpenTelemetrySdk;
import io.opentelemetry.sdk.metrics.SdkMeterProvider;
@ -40,10 +42,12 @@ public class CsmObservabilityServer {
private Server server;
private void start(int port) throws IOException {
server = Grpc.newServerBuilderForPort(port, InsecureServerCredentials.create())
.addService(new GreeterImpl())
.build()
.start();
server =
XdsServerBuilder.forPort(
port, XdsServerCredentials.create(InsecureServerCredentials.create()))
.addService(new GreeterImpl())
.build()
.start();
logger.info("Server started, listening on " + port);
}

View File

@ -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.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.68.2' // CURRENT_GRPC_VERSION
def protocVersion = '3.25.5'
dependencies {

View File

@ -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.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.68.2' // CURRENT_GRPC_VERSION
def protobufVersion = '3.25.5'
dependencies {

View File

@ -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.68.0-SNAPSHOT</version><!-- CURRENT_GRPC_VERSION -->
<version>1.68.2</version><!-- CURRENT_GRPC_VERSION -->
<name>example-hostname</name>
<url>https://github.com/grpc/grpc-java</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<grpc.version>1.68.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
<grpc.version>1.68.2</grpc.version><!-- CURRENT_GRPC_VERSION -->
<protoc.version>3.25.5</protoc.version>
<!-- required for jdk9 -->
<maven.compiler.source>1.8</maven.compiler.source>

View File

@ -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.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.68.2' // CURRENT_GRPC_VERSION
def protobufVersion = '3.25.5'
def protocVersion = protobufVersion

View File

@ -7,13 +7,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.68.0-SNAPSHOT</version><!-- CURRENT_GRPC_VERSION -->
<version>1.68.2</version><!-- CURRENT_GRPC_VERSION -->
<name>example-jwt-auth</name>
<url>https://github.com/grpc/grpc-java</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<grpc.version>1.68.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
<grpc.version>1.68.2</grpc.version><!-- CURRENT_GRPC_VERSION -->
<protobuf.version>3.25.5</protobuf.version>
<protoc.version>3.25.5</protoc.version>
<!-- required for jdk9 -->

View File

@ -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.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.68.2' // CURRENT_GRPC_VERSION
def protobufVersion = '3.25.5'
def protocVersion = protobufVersion

View File

@ -7,13 +7,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.68.0-SNAPSHOT</version><!-- CURRENT_GRPC_VERSION -->
<version>1.68.2</version><!-- CURRENT_GRPC_VERSION -->
<name>example-oauth</name>
<url>https://github.com/grpc/grpc-java</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<grpc.version>1.68.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
<grpc.version>1.68.2</grpc.version><!-- CURRENT_GRPC_VERSION -->
<protobuf.version>3.25.5</protobuf.version>
<protoc.version>3.25.5</protoc.version>
<!-- required for jdk9 -->

View File

@ -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.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.68.2' // CURRENT_GRPC_VERSION
def protocVersion = '3.25.5'
def openTelemetryVersion = '1.40.0'
def openTelemetryPrometheusVersion = '1.40.0-alpha'

View File

@ -18,7 +18,7 @@ java {
targetCompatibility = JavaVersion.VERSION_1_8
}
def grpcVersion = '1.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.68.2' // CURRENT_GRPC_VERSION
def protocVersion = '3.25.5'
dependencies {

View File

@ -18,7 +18,7 @@ java {
targetCompatibility = JavaVersion.VERSION_1_8
}
def grpcVersion = '1.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.68.2' // CURRENT_GRPC_VERSION
def protocVersion = '3.25.5'
dependencies {

View File

@ -16,7 +16,7 @@ java {
targetCompatibility = JavaVersion.VERSION_1_8
}
def grpcVersion = '1.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.68.2' // CURRENT_GRPC_VERSION
def protocVersion = '3.25.5'
dependencies {

View File

@ -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.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.68.2' // CURRENT_GRPC_VERSION
def protocVersion = '3.25.5'
dependencies {

View File

@ -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.68.0-SNAPSHOT</version><!-- CURRENT_GRPC_VERSION -->
<version>1.68.2</version><!-- CURRENT_GRPC_VERSION -->
<name>example-tls</name>
<url>https://github.com/grpc/grpc-java</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<grpc.version>1.68.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
<grpc.version>1.68.2</grpc.version><!-- CURRENT_GRPC_VERSION -->
<protoc.version>3.25.5</protoc.version>
<!-- required for jdk9 -->
<maven.compiler.source>1.8</maven.compiler.source>

View File

@ -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.68.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.68.2' // CURRENT_GRPC_VERSION
def protocVersion = '3.25.5'
dependencies {

View File

@ -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.68.0-SNAPSHOT</version><!-- CURRENT_GRPC_VERSION -->
<version>1.68.2</version><!-- CURRENT_GRPC_VERSION -->
<name>examples</name>
<url>https://github.com/grpc/grpc-java</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<grpc.version>1.68.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
<grpc.version>1.68.2</grpc.version><!-- CURRENT_GRPC_VERSION -->
<protobuf.version>3.25.5</protobuf.version>
<protoc.version>3.25.5</protoc.version>
<!-- required for JDK 8 -->

View File

@ -14,6 +14,6 @@
<!-- [START config] -->
<appengine-web-app xmlns='http://appengine.google.com/ns/1.0'>
<service>java-gae-interop-test</service>
<runtime>java11</runtime>
<runtime>java17</runtime>
</appengine-web-app>
<!-- [END config] -->

View File

@ -515,21 +515,6 @@ class OkHttpClientTransport implements ConnectionClientTransport, TransportExcep
serializingExecutor.execute(new Runnable() {
@Override
public void run() {
// This is a hack to make sure the connection preface and initial settings to be sent out
// without blocking the start. By doing this essentially prevents potential deadlock when
// network is not available during startup while another thread holding lock to send the
// initial preface.
try {
latch.await();
barrier.await(1000, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
} catch (TimeoutException | BrokenBarrierException e) {
startGoAway(0, ErrorCode.INTERNAL_ERROR, Status.UNAVAILABLE
.withDescription("Timed out waiting for second handshake thread. "
+ "The transport executor pool may have run out of threads"));
return;
}
// Use closed source on failure so that the reader immediately shuts down.
BufferedSource source = Okio.buffer(new Source() {
@Override
@ -549,6 +534,22 @@ class OkHttpClientTransport implements ConnectionClientTransport, TransportExcep
Socket sock;
SSLSession sslSession = null;
try {
// This is a hack to make sure the connection preface and initial settings to be sent out
// without blocking the start. By doing this essentially prevents potential deadlock when
// network is not available during startup while another thread holding lock to send the
// initial preface.
try {
latch.await();
barrier.await(1000, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
} catch (TimeoutException | BrokenBarrierException e) {
startGoAway(0, ErrorCode.INTERNAL_ERROR, Status.UNAVAILABLE
.withDescription("Timed out waiting for second handshake thread. "
+ "The transport executor pool may have run out of threads"));
return;
}
if (proxiedAddr == null) {
sock = socketFactory.createSocket(address.getAddress(), address.getPort());
} else {

View File

@ -335,7 +335,6 @@ public final class ServerCalls {
private boolean aborted = false;
private boolean completed = false;
private Runnable onCloseHandler;
private RespT unaryResponse;
// Non private to avoid synthetic class
ServerCallStreamObserverImpl(ServerCall<ReqT, RespT> call, boolean serverStreamingOrBidi) {
@ -374,22 +373,15 @@ public final class ServerCalls {
}
checkState(!aborted, "Stream was terminated by error, no further calls are allowed");
checkState(!completed, "Stream is already completed, no further calls are allowed");
if (serverStreamingOrBidi) {
if (!sentHeaders) {
call.sendHeaders(new Metadata());
sentHeaders = true;
}
call.sendMessage(response);
} else {
unaryResponse = response;
if (!sentHeaders) {
call.sendHeaders(new Metadata());
sentHeaders = true;
}
call.sendMessage(response);
}
@Override
public void onError(Throwable t) {
if (!serverStreamingOrBidi) {
unaryResponse = null;
}
Metadata metadata = Status.trailersFromThrowable(t);
if (metadata == null) {
metadata = new Metadata();
@ -400,14 +392,6 @@ public final class ServerCalls {
@Override
public void onCompleted() {
if (!serverStreamingOrBidi && unaryResponse != null) {
if (!sentHeaders) {
call.sendHeaders(new Metadata());
sentHeaders = true;
}
call.sendMessage(unaryResponse);
unaryResponse = null;
}
call.close(Status.OK, new Metadata());
completed = true;
}

View File

@ -33,7 +33,6 @@ import io.grpc.ServerCallHandler;
import io.grpc.ServerServiceDefinition;
import io.grpc.ServiceDescriptor;
import io.grpc.Status;
import io.grpc.Status.Code;
import io.grpc.StatusRuntimeException;
import io.grpc.inprocess.InProcessChannelBuilder;
import io.grpc.inprocess.InProcessServerBuilder;
@ -621,59 +620,6 @@ public class ServerCallsTest {
assertArrayEquals(new int[]{0, 1, 1, 2, 2, 2}, receivedMessages);
}
@Test
public void serverUnaryResponseMsgWithOkStatus() {
ServerCallHandler<Integer, Integer> serverCallHandler =
ServerCalls.asyncUnaryCall(
new ServerCalls.UnaryMethod<Integer, Integer>() {
@Override
public void invoke(Integer request, StreamObserver<Integer> responseObserver) {
responseObserver.onNext(request);
responseObserver.onCompleted();
}
});
ServerCall.Listener<Integer> callListener =
serverCallHandler.startCall(serverCall, new Metadata());
serverCall.isReady = true;
serverCall.isCancelled = false;
callListener.onReady();
callListener.onMessage(1);
callListener.onHalfClose();
assertThat(serverCall.status.getCode()).isEqualTo(Code.OK);
assertThat(serverCall.responses).containsExactly(1);
}
@Test
public void serverUnaryResponseMsgWithNotOkStatus() {
ServerCallHandler<Integer, Integer> serverCallHandler =
ServerCalls.asyncUnaryCall(
new ServerCalls.UnaryMethod<Integer, Integer>() {
@Override
public void invoke(Integer request, StreamObserver<Integer> responseObserver) {
responseObserver.onNext(request);
responseObserver.onError(
Status.INTERNAL
.withDescription("Response message is null for unary call")
.asRuntimeException());
}
});
ServerCall.Listener<Integer> callListener =
serverCallHandler.startCall(serverCall, new Metadata());
serverCall.isReady = true;
serverCall.isCancelled = false;
callListener.onReady();
callListener.onMessage(1);
callListener.onHalfClose();
assertThat(serverCall.status.getCode()).isEqualTo(Code.INTERNAL);
assertThat(serverCall.status.getDescription())
.isEqualTo("Response message is null for unary call");
assertThat(serverCall.responses).isEmpty();
}
public static class IntegerMarshaller implements MethodDescriptor.Marshaller<Integer> {
@Override
public InputStream stream(Integer value) {