Compare commits

...

11 Commits

Author SHA1 Message Date
Eric Anderson 7292ed8f75 Bump version to 1.57.1 2023-08-01 10:05:23 -07:00
Eric Anderson adfa669edc Update README etc to reference 1.57.1 2023-08-01 10:05:12 -07:00
Eric Anderson 3e69c26f3a Avoid accidental Java 9+ dependency with --release
In d654707 we swapped compiling the uploaded artifacts to Java 11. This
caused ABI issues with ByteBuffer, like clear() returning ByteBuffer
instead of Buffer.

There are source-level approaches to avoid the accidental ABI dependency
on Java 11, but we have no tool able to detect such breakages.
We use Animalsniffer for similar cases, but it fails to detect these[1].
Since we have no tool, source-level approaches can't gain the necessary
confidence that all incompatibility fixes have been resolved.

Java has had javac-level ways to address this, but they used to require
setting bootclasspath. Since Java 9, though, they made it easier and we
can use --release, which does exactly what we need.

Fixes #10432

1. https://github.com/mojohaus/animal-sniffer/issues/77
2023-08-01 07:41:40 -07:00
Tony An 38e0a0f971
(backport v1.57) removed assert statement for static stride scheduler with multiple threads (#10438) 2023-07-31 15:36:40 -07:00
larry-safran 503883bcf2 Bump version to 1.57.1-SNAPSHOT 2023-07-25 17:24:29 -07:00
larry-safran cde208afce Bump version to 1.57.0 2023-07-25 17:24:29 -07:00
larry-safran 61ad5f4f6d Update README etc to reference 1.57.0 2023-07-25 17:24:29 -07:00
Larry Safran 4d75056b78
Revert "Release v1.57.0 (#10417)" (#10419)
This reverts commit d23e39e64b.
2023-07-25 14:09:15 -07:00
Larry Safran d23e39e64b
Release v1.57.0 (#10417)
* Update README etc to reference 1.57.0

* Bump version to 1.57.0

* Bump version to 1.57.1-SNAPSHOT
2023-07-25 11:31:54 -07:00
Larry Safran 22de21642f
Handle header with errors and endStream = true (#10384) (#10414)
* Eliminate NPE by skipping further processing when stream is defined, but doesn't have a property for streamKey (header processing identified an error)

Fixes #10364

* Add unit test for missing content type
2023-07-24 16:54:44 -07:00
Eric Anderson c96b7d5038 Downgrade Netty to 4.1.93-Final
Our benchmarks saw a serious performance decrease with the upgrade from
Netty 4.1.88 to 4.1.94. The problem was tracked down to a single PR in
4.1.94, so we avoid 4.1.94 for now.

Fixes #10401
2023-07-24 13:45:38 -07:00
41 changed files with 134 additions and 105 deletions

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.56.0/examples) and the
[Android example](https://github.com/grpc/grpc-java/tree/v1.56.0/examples/android)
The [examples](https://github.com/grpc/grpc-java/tree/v1.57.1/examples) and the
[Android example](https://github.com/grpc/grpc-java/tree/v1.57.1/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.56.0</version>
<version>1.57.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>1.56.0</version>
<version>1.57.1</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>1.56.0</version>
<version>1.57.1</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.56.0'
implementation 'io.grpc:grpc-protobuf:1.56.0'
implementation 'io.grpc:grpc-stub:1.56.0'
runtimeOnly 'io.grpc:grpc-netty-shaded:1.57.1'
implementation 'io.grpc:grpc-protobuf:1.57.1'
implementation 'io.grpc:grpc-stub:1.57.1'
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.56.0'
implementation 'io.grpc:grpc-protobuf-lite:1.56.0'
implementation 'io.grpc:grpc-stub:1.56.0'
implementation 'io.grpc:grpc-okhttp:1.57.1'
implementation 'io.grpc:grpc-protobuf-lite:1.57.1'
implementation 'io.grpc:grpc-stub:1.57.1'
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.56.0
https://search.maven.org/search?q=g:io.grpc%20AND%20v:1.57.1
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.22.3:exe:${os.detected.classifier}</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.56.0:exe:${os.detected.classifier}</pluginArtifact>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.57.1:exe:${os.detected.classifier}</pluginArtifact>
</configuration>
<executions>
<execution>
@ -161,7 +161,7 @@ protobuf {
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.56.0'
artifact = 'io.grpc:protoc-gen-grpc-java:1.57.1'
}
}
generateProtoTasks {
@ -194,7 +194,7 @@ protobuf {
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.56.0'
artifact = 'io.grpc:protoc-gen-grpc-java:1.57.1'
}
}
generateProtoTasks {

View File

@ -396,7 +396,7 @@ grpc-netty version | netty-handler version | netty-tcnative-boringssl-static ver
1.50.x-1.53.x | 4.1.79.Final | 2.0.54.Final
1.54.x-1.55.x | 4.1.87.Final | 2.0.56.Final
1.56.x | 4.1.87.Final | 2.0.61.Final
1.57.x- | 4.1.94.Final | 2.0.61.Final
1.57.x- | 4.1.93.Final | 2.0.61.Final
_(grpc-netty-shaded avoids issues with keeping these versions in sync.)_

View File

@ -16,9 +16,13 @@ sourceSets {
}
}
compileContextJava {
sourceCompatibility = 1.7
targetCompatibility = 1.7
tasks.named("compileContextJava").configure {
if (JavaVersion.current().isJava9Compatible()) {
options.release = 7
} else {
sourceCompatibility = 1.7
targetCompatibility = 1.7
}
}

View File

@ -20,7 +20,7 @@ subprojects {
apply plugin: "net.ltgt.errorprone"
group = "io.grpc"
version = "1.57.0-SNAPSHOT" // CURRENT_GRPC_VERSION
version = "1.57.1" // CURRENT_GRPC_VERSION
repositories {
maven { // The google mirror is less flaky than mavenCentral()
@ -181,9 +181,6 @@ subprojects {
}
plugins.withId("java") {
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
testImplementation libraries.junit,
libraries.mockito.core,
@ -239,6 +236,14 @@ subprojects {
}
}
tasks.withType(JavaCompile).configureEach {
if (JavaVersion.current().isJava9Compatible()) {
options.release = 8
} else {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}
tasks.named("compileJava").configure {
// This project targets Java 7 (no time.Duration class)
options.errorprone.check("PreferJavaTimeOverload", CheckSeverity.OFF)
@ -279,10 +284,6 @@ subprojects {
plugins.withId("me.champeau.jmh") {
// invoke jmh on a single benchmark class like so:
// ./gradlew -PjmhIncludeSingleClass=StatsTraceContextBenchmark clean :grpc-core:jmh
tasks.named("compileJmhJava").configure {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
tasks.named("jmh").configure {
warmupIterations = 10
iterations = 10

View File

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

View File

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

View File

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

View File

@ -2106,6 +2106,9 @@ public abstract class AbstractTransportTest {
* be present, and the cause should be stripped away.
*/
private static void checkClientStatus(Status expectedStatus, Status clientStreamStatus) {
if (!clientStreamStatus.isOk() && clientStreamStatus.getCode() != expectedStatus.getCode()) {
System.out.println("Full Status: " + clientStreamStatus);
}
assertEquals(expectedStatus.getCode(), clientStreamStatus.getCode());
assertEquals(expectedStatus.getDescription(), clientStreamStatus.getDescription());
assertNull(clientStreamStatus.getCause());

View File

@ -34,7 +34,7 @@ android {
protobuf {
protoc { artifact = 'com.google.protobuf:protoc:3.22.3' }
plugins {
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.57.1' // CURRENT_GRPC_VERSION
}
}
generateProtoTasks {
@ -54,12 +54,12 @@ dependencies {
implementation 'com.android.support:appcompat-v7:27.0.2'
// You need to build grpc-java to obtain these libraries below.
implementation 'io.grpc:grpc-okhttp:1.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-okhttp:1.57.1' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.57.1' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.57.1' // CURRENT_GRPC_VERSION
implementation 'org.apache.tomcat:annotations-api:6.0.53'
testImplementation 'junit:junit:4.13.2'
testImplementation 'com.google.truth:truth:1.0.1'
testImplementation 'io.grpc:grpc-testing:1.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
testImplementation 'io.grpc:grpc-testing:1.57.1' // CURRENT_GRPC_VERSION
}

View File

@ -32,7 +32,7 @@ android {
protobuf {
protoc { artifact = 'com.google.protobuf:protoc:3.22.3' }
plugins {
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.57.1' // CURRENT_GRPC_VERSION
}
}
generateProtoTasks {
@ -52,8 +52,8 @@ dependencies {
implementation 'com.android.support:appcompat-v7:27.0.2'
// You need to build grpc-java to obtain these libraries below.
implementation 'io.grpc:grpc-okhttp:1.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-okhttp:1.57.1' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.57.1' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.57.1' // 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.22.3' }
plugins {
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.57.1' // CURRENT_GRPC_VERSION
}
}
generateProtoTasks {
@ -52,8 +52,8 @@ dependencies {
implementation 'com.android.support:appcompat-v7:27.0.2'
// You need to build grpc-java to obtain these libraries below.
implementation 'io.grpc:grpc-okhttp:1.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-okhttp:1.57.1' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.57.1' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.57.1' // 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.22.3' }
plugins {
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.57.1' // CURRENT_GRPC_VERSION
}
}
generateProtoTasks {
@ -53,8 +53,8 @@ dependencies {
implementation 'com.android.support:appcompat-v7:28.0.0'
// You need to build grpc-java to obtain these libraries below.
implementation 'io.grpc:grpc-okhttp:1.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-okhttp:1.57.1' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.57.1' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.57.1' // CURRENT_GRPC_VERSION
implementation 'org.apache.tomcat:annotations-api:6.0.53'
}

View File

@ -21,7 +21,7 @@ targetCompatibility = 1.8
// 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.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.57.1' // CURRENT_GRPC_VERSION
def protobufVersion = '3.22.3'
def protocVersion = protobufVersion

View File

@ -23,7 +23,7 @@ targetCompatibility = 1.8
// 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.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.57.1' // CURRENT_GRPC_VERSION
def protocVersion = '3.22.3'
dependencies {

View File

@ -23,7 +23,7 @@ targetCompatibility = 1.8
// 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.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.57.1' // CURRENT_GRPC_VERSION
def protobufVersion = '3.22.3'
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.57.0-SNAPSHOT</version><!-- CURRENT_GRPC_VERSION -->
<version>1.57.1</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.57.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
<grpc.version>1.57.1</grpc.version><!-- CURRENT_GRPC_VERSION -->
<protoc.version>3.22.3</protoc.version>
<!-- required for jdk9 -->
<maven.compiler.source>1.8</maven.compiler.source>

View File

@ -23,7 +23,7 @@ targetCompatibility = 1.8
// 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.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.57.1' // CURRENT_GRPC_VERSION
def protobufVersion = '3.22.3'
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.57.0-SNAPSHOT</version><!-- CURRENT_GRPC_VERSION -->
<version>1.57.1</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.57.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
<grpc.version>1.57.1</grpc.version><!-- CURRENT_GRPC_VERSION -->
<protobuf.version>3.22.3</protobuf.version>
<!-- required for jdk9 -->
<maven.compiler.source>1.8</maven.compiler.source>

View File

@ -24,7 +24,7 @@ targetCompatibility = 1.8
// 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.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.57.1' // CURRENT_GRPC_VERSION
def protocVersion = '3.22.3'
dependencies {

View File

@ -21,7 +21,7 @@ targetCompatibility = 1.8
// 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.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.57.1' // CURRENT_GRPC_VERSION
def protobufVersion = '3.22.3'
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.57.0-SNAPSHOT</version><!-- CURRENT_GRPC_VERSION -->
<version>1.57.1</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.57.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
<grpc.version>1.57.1</grpc.version><!-- CURRENT_GRPC_VERSION -->
<protoc.version>3.22.3</protoc.version>
<!-- required for jdk9 -->
<maven.compiler.source>1.8</maven.compiler.source>

View File

@ -22,7 +22,7 @@ targetCompatibility = 1.8
// 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.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.57.1' // CURRENT_GRPC_VERSION
def protobufVersion = '3.22.3'
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.57.0-SNAPSHOT</version><!-- CURRENT_GRPC_VERSION -->
<version>1.57.1</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.57.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
<grpc.version>1.57.1</grpc.version><!-- CURRENT_GRPC_VERSION -->
<protobuf.version>3.22.3</protobuf.version>
<protoc.version>3.22.3</protoc.version>
<!-- required for jdk9 -->

View File

@ -17,7 +17,7 @@ repositories {
sourceCompatibility = 1.8
targetCompatibility = 1.8
def grpcVersion = '1.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.57.1' // CURRENT_GRPC_VERSION
def protocVersion = '3.22.3'
dependencies {

View File

@ -17,7 +17,7 @@ repositories {
sourceCompatibility = 1.8
targetCompatibility = 1.8
def grpcVersion = '1.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.57.1' // CURRENT_GRPC_VERSION
def protocVersion = '3.22.3'
dependencies {

View File

@ -15,7 +15,7 @@ repositories {
sourceCompatibility = 1.8
targetCompatibility = 1.8
def grpcVersion = '1.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.57.1' // CURRENT_GRPC_VERSION
def protocVersion = '3.22.3'
dependencies {

View File

@ -23,7 +23,7 @@ targetCompatibility = 1.8
// 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.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.57.1' // CURRENT_GRPC_VERSION
def protocVersion = '3.22.3'
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.57.0-SNAPSHOT</version><!-- CURRENT_GRPC_VERSION -->
<version>1.57.1</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.57.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
<grpc.version>1.57.1</grpc.version><!-- CURRENT_GRPC_VERSION -->
<protoc.version>3.22.3</protoc.version>
<!-- required for jdk9 -->
<maven.compiler.source>1.8</maven.compiler.source>

View File

@ -22,7 +22,7 @@ targetCompatibility = 1.8
// 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.57.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def grpcVersion = '1.57.1' // CURRENT_GRPC_VERSION
def protocVersion = '3.22.3'
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.57.0-SNAPSHOT</version><!-- CURRENT_GRPC_VERSION -->
<version>1.57.1</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.57.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
<grpc.version>1.57.1</grpc.version><!-- CURRENT_GRPC_VERSION -->
<protobuf.version>3.22.3</protobuf.version>
<protoc.version>3.22.3</protoc.version>
<!-- required for JDK 8 -->

View File

@ -90,9 +90,6 @@ appengine {
group = 'io.grpc' // Generated output GroupId
version = '1.0-SNAPSHOT' // Version in generated output
sourceCompatibility = 1.8
targetCompatibility = 1.8
/** Returns the service name. */
String getGaeProject() {
def stream = new ByteArrayOutputStream()

View File

@ -3,7 +3,7 @@
# https://github.com/grpc/grpc-java/pull/9118
googleauth = "1.4.0"
guava = "32.0.1-android"
netty = '4.1.94.Final'
netty = '4.1.93.Final'
# Keep the following references of tcnative version in sync whenever it's updated:
# SECURITY.md
nettytcnative = '2.0.61.Final'

View File

@ -512,6 +512,9 @@ class NettyServerHandler extends AbstractNettyHandler {
flowControlPing().onDataRead(data.readableBytes(), padding);
try {
NettyServerStream.TransportState stream = serverStream(requireHttp2Stream(streamId));
if (stream == null) {
return;
}
try (TaskCloseable ignore = PerfMark.traceTask("NettyServerHandler.onDataRead")) {
PerfMark.attachTag(stream.tag());
stream.inboundDataReceived(data, endOfStream);
@ -679,12 +682,14 @@ class NettyServerHandler extends AbstractNettyHandler {
private void closeStreamWhenDone(ChannelPromise promise, int streamId) throws Http2Exception {
final NettyServerStream.TransportState stream = serverStream(requireHttp2Stream(streamId));
promise.addListener(new ChannelFutureListener() {
@Override
public void operationComplete(ChannelFuture future) {
stream.complete();
}
});
if (stream != null) {
promise.addListener(new ChannelFutureListener() {
@Override
public void operationComplete(ChannelFuture future) {
stream.complete();
}
});
}
}
/**

View File

@ -634,6 +634,34 @@ public class NettyServerHandlerTest extends NettyHandlerTestBase<NettyServerHand
any(ChannelPromise.class));
}
@Test
public void headersWithErrAndEndStreamReturnErrorButNotThrowNpe() throws Exception {
manualSetUp();
Http2Headers headers = new DefaultHttp2Headers()
.method(HTTP_METHOD)
.add(AsciiString.of("host"), AsciiString.of("example.com"))
.path(new AsciiString("/foo/bar"));
ByteBuf headersFrame = headersFrame(STREAM_ID, headers);
channelRead(headersFrame);
channelRead(emptyGrpcFrame(STREAM_ID, true));
Http2Headers responseHeaders = new DefaultHttp2Headers()
.set(InternalStatus.CODE_KEY.name(), String.valueOf(Code.INTERNAL.value()))
.set(InternalStatus.MESSAGE_KEY.name(), "Content-Type is missing from the request")
.status("" + 415)
.set(CONTENT_TYPE_HEADER, "text/plain; charset=utf-8");
verifyWrite()
.writeHeaders(
eq(ctx()),
eq(STREAM_ID),
eq(responseHeaders),
eq(0),
eq(false),
any(ChannelPromise.class));
}
@Test
public void headersWithAuthorityAndHostUsesAuthority() throws Exception {
manualSetUp();

View File

@ -25,20 +25,20 @@ IO_GRPC_GRPC_JAVA_ARTIFACTS = [
"com.google.truth:truth:1.0.1",
"com.squareup.okhttp:okhttp:2.7.5",
"com.squareup.okio:okio:1.17.5",
"io.netty:netty-buffer:4.1.94.Final",
"io.netty:netty-codec-http2:4.1.94.Final",
"io.netty:netty-codec-http:4.1.94.Final",
"io.netty:netty-codec-socks:4.1.94.Final",
"io.netty:netty-codec:4.1.94.Final",
"io.netty:netty-common:4.1.94.Final",
"io.netty:netty-handler-proxy:4.1.94.Final",
"io.netty:netty-handler:4.1.94.Final",
"io.netty:netty-resolver:4.1.94.Final",
"io.netty:netty-buffer:4.1.93.Final",
"io.netty:netty-codec-http2:4.1.93.Final",
"io.netty:netty-codec-http:4.1.93.Final",
"io.netty:netty-codec-socks:4.1.93.Final",
"io.netty:netty-codec:4.1.93.Final",
"io.netty:netty-common:4.1.93.Final",
"io.netty:netty-handler-proxy:4.1.93.Final",
"io.netty:netty-handler:4.1.93.Final",
"io.netty:netty-resolver:4.1.93.Final",
"io.netty:netty-tcnative-boringssl-static:2.0.61.Final",
"io.netty:netty-tcnative-classes:2.0.61.Final",
"io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.94.Final",
"io.netty:netty-transport-native-unix-common:4.1.94.Final",
"io.netty:netty-transport:4.1.94.Final",
"io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.93.Final",
"io.netty:netty-transport-native-unix-common:4.1.93.Final",
"io.netty:netty-transport:4.1.93.Final",
"io.opencensus:opencensus-api:0.31.0",
"io.opencensus:opencensus-contrib-grpc-metrics:0.31.0",
"io.perfmark:perfmark-api:0.26.0",

View File

@ -5,10 +5,6 @@ plugins {
description = "gRPC: Servlet"
// javax.servlet-api 4.0 requires a minimum of Java 8, so we might as well use that source level
sourceCompatibility = 1.8
targetCompatibility = 1.8
def jettyVersion = '10.0.7'
configurations {

View File

@ -4,8 +4,6 @@ plugins {
}
description = "gRPC: Jakarta Servlet"
sourceCompatibility = 1.8
targetCompatibility = 1.8
// Set up classpaths and source directories for different servlet tests
configurations {

View File

@ -431,9 +431,7 @@ final class WeightedRoundRobinLoadBalancer extends RoundRobinLoadBalancer {
* an offset that varies per backend index is also included to the calculation.
*/
int pick() {
int i = 0;
while (true) {
i++;
long sequence = this.nextSequence();
int backendIndex = (int) (sequence % scaledWeights.length);
long generation = sequence / scaledWeights.length;
@ -442,7 +440,6 @@ final class WeightedRoundRobinLoadBalancer extends RoundRobinLoadBalancer {
if ((weight * generation + offset) % K_MAX_WEIGHT < K_MAX_WEIGHT - weight) {
continue;
}
assert i <= scaledWeights.length : "scheduler has more than one pass through";
return backendIndex;
}
}

View File

@ -943,7 +943,7 @@ public class WeightedRoundRobinLoadBalancerTest {
Map<Integer, Integer> pickCount = new HashMap<>();
for (int i = 0; i < 1000; i++) {
int result = sss.pick();
pickCount.put(result, pickCount.getOrDefault(result, 0) + 1);
pickCount.merge(result, 1, (o, v) -> o + v);
}
for (int i = 0; i < 3; i++) {
assertThat(Math.abs(pickCount.getOrDefault(i, 0) / 1000.0 - weights[i] / totalWeight))