mirror of https://github.com/grpc/grpc-java.git
Compare commits
11 Commits
Author | SHA1 | Date |
---|---|---|
|
7292ed8f75 | |
|
adfa669edc | |
|
3e69c26f3a | |
|
38e0a0f971 | |
|
503883bcf2 | |
|
cde208afce | |
|
61ad5f4f6d | |
|
4d75056b78 | |
|
d23e39e64b | |
|
22de21642f | |
|
c96b7d5038 |
30
README.md
30
README.md
|
@ -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 {
|
||||
|
|
|
@ -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.)_
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
17
build.gradle
17
build.gradle
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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'
|
||||
}
|
||||
|
|
|
@ -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'
|
||||
}
|
||||
|
|
|
@ -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'
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 -->
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 -->
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue