Skip to content

Commit 6a928f4

Browse files
committed
Merge branch 'master' into android_channel
2 parents 5ded152 + a47266e commit 6a928f4

File tree

276 files changed

+9892
-2778
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

276 files changed

+9892
-2778
lines changed

.travis.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,17 @@ script:
3636
- ./gradlew check :grpc-all:jacocoTestReport
3737

3838
after_success:
39-
- if \[ "$TRAVIS_OS_NAME" = linux \]; then ./gradlew :grpc-all:coveralls; fi
39+
# Upload to coveralls once, instead of for each job in the matrix
40+
- if \[\[ "$TRAVIS_JOB_NUMBER" == *.1 \]\]; then ./gradlew :grpc-all:coveralls; fi
4041
- bash <(curl -s https://codecov.io/bash)
4142

4243
os:
4344
- linux
4445

46+
jdk:
47+
- oraclejdk8
48+
- oraclejdk9
49+
4550
notifications:
4651
email: false
4752

README.md

+26-13
Original file line numberDiff line numberDiff line change
@@ -30,37 +30,37 @@ Download [the JARs][]. Or for Maven with non-Android, add to your `pom.xml`:
3030
<dependency>
3131
<groupId>io.grpc</groupId>
3232
<artifactId>grpc-netty</artifactId>
33-
<version>1.10.0</version>
33+
<version>1.11.0</version>
3434
</dependency>
3535
<dependency>
3636
<groupId>io.grpc</groupId>
3737
<artifactId>grpc-protobuf</artifactId>
38-
<version>1.10.0</version>
38+
<version>1.11.0</version>
3939
</dependency>
4040
<dependency>
4141
<groupId>io.grpc</groupId>
4242
<artifactId>grpc-stub</artifactId>
43-
<version>1.10.0</version>
43+
<version>1.11.0</version>
4444
</dependency>
4545
```
4646

4747
Or for Gradle with non-Android, add to your dependencies:
4848
```gradle
49-
compile 'io.grpc:grpc-netty:1.10.0'
50-
compile 'io.grpc:grpc-protobuf:1.10.0'
51-
compile 'io.grpc:grpc-stub:1.10.0'
49+
compile 'io.grpc:grpc-netty:1.11.0'
50+
compile 'io.grpc:grpc-protobuf:1.11.0'
51+
compile 'io.grpc:grpc-stub:1.11.0'
5252
```
5353

5454
For Android client, use `grpc-okhttp` instead of `grpc-netty` and
5555
`grpc-protobuf-lite` or `grpc-protobuf-nano` instead of `grpc-protobuf`:
5656
```gradle
57-
compile 'io.grpc:grpc-okhttp:1.10.0'
58-
compile 'io.grpc:grpc-protobuf-lite:1.10.0'
59-
compile 'io.grpc:grpc-stub:1.10.0'
57+
compile 'io.grpc:grpc-okhttp:1.11.0'
58+
compile 'io.grpc:grpc-protobuf-lite:1.11.0'
59+
compile 'io.grpc:grpc-stub:1.11.0'
6060
```
6161

6262
[the JARs]:
63-
http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22io.grpc%22%20AND%20v%3A%221.9.0%22
63+
http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22io.grpc%22%20AND%20v%3A%221.11.0%22
6464

6565
Development snapshots are available in [Sonatypes's snapshot
6666
repository](https://oss.sonatype.org/content/repositories/snapshots/).
@@ -85,11 +85,11 @@ For protobuf-based codegen integrated with the Maven build system, you can use
8585
<plugin>
8686
<groupId>org.xolstice.maven.plugins</groupId>
8787
<artifactId>protobuf-maven-plugin</artifactId>
88-
<version>0.5.0</version>
88+
<version>0.5.1</version>
8989
<configuration>
9090
<protocArtifact>com.google.protobuf:protoc:3.5.1-1:exe:${os.detected.classifier}</protocArtifact>
9191
<pluginId>grpc-java</pluginId>
92-
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.10.0:exe:${os.detected.classifier}</pluginArtifact>
92+
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.11.0:exe:${os.detected.classifier}</pluginArtifact>
9393
</configuration>
9494
<executions>
9595
<execution>
@@ -129,7 +129,7 @@ protobuf {
129129
}
130130
plugins {
131131
grpc {
132-
artifact = 'io.grpc:protoc-gen-grpc-java:1.10.0'
132+
artifact = 'io.grpc:protoc-gen-grpc-java:1.11.0'
133133
}
134134
}
135135
generateProtoTasks {
@@ -239,3 +239,16 @@ The [examples](https://github.com/grpc/grpc-java/tree/master/examples)
239239
and the
240240
[Android example](https://github.com/grpc/grpc-java/tree/master/examples/android) are standalone projects that
241241
showcase the usage of gRPC.
242+
243+
Tools
244+
-----
245+
246+
APIs annotated with `@Internal` are for internal use by the gRPC library and
247+
should not be used by gRPC users. APIs annotated with `@ExperimentalApi` are
248+
subject to change in future releases, and library code that other projects
249+
may depend on should not use these APIs. We recommend using the
250+
[grpc-java-api-checker](https://github.com/grpc/grpc-java-api-checker)
251+
(an [Error Prone](https://github.com/google/error-prone) plugin)
252+
to check for usages of `@ExperimentalApi` and `@Internal` in any library code
253+
that depends on gRPC. It may also be used to check for `@Internal` usage or
254+
unintended `@ExperimentalApi` consumption in non-library code.

RELEASING.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ Tagging the Release
128128
version was updated since the last release.
129129

130130
```bash
131-
$ git checkout -b release v$MAJOR.$MINOR.x
131+
$ git checkout v$MAJOR.$MINOR.x
132+
$ git pull upstream v$MAJOR.$MINOR.x
133+
$ git checkout -b release
132134
# Bump documented versions. Don't forget protobuf version
133135
$ ${EDITOR:-nano -w} README.md
134136
$ git commit -a -m "Update README to reference $MAJOR.$MINOR.$PATCH"
@@ -161,8 +163,8 @@ Tagging the Release
161163
```bash
162164
$ git checkout v$MAJOR.$MINOR.x
163165
$ git merge --ff-only release
164-
$ git push upstream v$MAJOR.$MINOR.$PATCH
165166
$ git push upstream v$MAJOR.$MINOR.x
167+
$ git push upstream v$MAJOR.$MINOR.$PATCH
166168
```
167169
6. Close the release milestone.
168170

SECURITY.md

+24-6
Original file line numberDiff line numberDiff line change
@@ -318,13 +318,31 @@ public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall(ServerCall<RespT> c
318318
If you received an error message "ALPN is not configured properly" or "Jetty ALPN/NPN has not been properly configured", it most likely means that:
319319
- ALPN related dependencies are either not present in the classpath
320320
- or that there is a classpath conflict
321-
- or that a wrong version is used due to dependency management.
321+
- or that a wrong version is used due to dependency management
322+
- or you are on an unsupported platform (e.g., 32-bit OS, Alpine with `musl` libc). See [Transport Security](#transport-security-tls) for supported platforms.
322323

323324
### Netty
324325
If you aren't using gRPC on Android devices, you are most likely using `grpc-netty` transport.
325326

326327
If you are developing for Android and have a dependency on `grpc-netty`, you should remove it as `grpc-netty` is unsupported on Android. Use `grpc-okhttp` instead.
327328

329+
If you are on a 32-bit operating system, or not on a [Transport Security supported platform](#transport-security-tls), you should use Jetty ALPN (and beware of potential issues), or you'll need to build your own 32-bit version of `netty-tcnative`.
330+
331+
If you are using `musl` libc (e.g., with Alpine Linux), then
332+
`netty-tcnative-boringssl-static` won't work. There are several alternatives:
333+
- Use [netty-tcnative-alpine](https://github.com/pires/netty-tcnative-alpine)
334+
- Use a distribution with `glibc`
335+
336+
If you are running inside of an embedded Tomcat runtime (e.g., Spring Boot),
337+
then some versions of `netty-tcnative-boringssl-static` will have conflicts and
338+
won't work. You must use gRPC 1.4.0 or later.
339+
340+
Most dependency versioning problems can be solved by using
341+
`io.grpc:grpc-netty-shaded` instead of `io.grpc:grpc-netty`, although this also
342+
limits your usage of the Netty-specific APIs. `io.grpc:grpc-netty-shaded`
343+
includes the proper version of Netty and `netty-tcnative-boringssl-static` in a
344+
way that won't conflict with other Netty usages.
345+
328346
Find the dependency tree (e.g., `mvn dependency:tree`), and look for versions of:
329347
- `io.grpc:grpc-netty`
330348
- `io.netty:netty-handler` (really, make sure all of io.netty except for
@@ -337,11 +355,9 @@ If you have both `netty-handler` and `netty-tcnative-boringssl-static` dependenc
337355

338356
If you have other `netty` dependencies, such as `netty-all`, that are pulled in from other libraries, then ultimately you should make sure only one `netty` dependency is used to avoid classpath conflict. The easiest way is to exclude transitive Netty dependencies from all the immediate dependencies, e.g., in Maven use `<exclusions>`, and then add an explict Netty dependency in your project along with the corresponding `tcnative` versions. See the versions table below.
339357

340-
If you are using `musl` libc (e.g., with Alpine Linux), then `netty-tcnative-boringssl-static` won't work. There are several alternatives:
341-
- Use [netty-tcnative-alpine] (https://github.com/pires/netty-tcnative-alpine)
342-
- Use a distribution with `glibc`
343-
344-
If you are running inside of an embedded Tomcat runtime (e.g., Spring Boot), then some versions of `netty-tcnative-boringssl-static` will have conflicts and won't work. You must use gRPC 1.4.0 or later.
358+
If you are running in a runtime environment that also uses Netty (e.g., Hadoop, Spark, Spring Boot 2) and you have no control over the Netty version at all, then you should use a shaded gRPC Netty dependency to avoid classpath conflicts with other Netty versions in runtime the classpath:
359+
- Remove `io.grpc:grpc-netty` dependency
360+
- Add `io.grpc:grpc-netty-shaded` dependency
345361

346362
Below are known to work version combinations:
347363

@@ -357,6 +373,8 @@ grpc-netty version | netty-handler version | netty-tcnative-boringssl-static ver
357373
1.9.x-1.10.x | 4.1.17.Final | 2.0.7.Final
358374
1.11.x- | 4.1.22.Final | 2.0.7.Final
359375

376+
_(grpc-netty-shaded avoids issues with keeping these versions in sync.)_
377+
360378
### OkHttp
361379
If you are using gRPC on Android devices, you are most likely using `grpc-okhttp` transport.
362380

alts/build.gradle

+2-8
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ dependencies {
2222
project(':grpc-stub'),
2323
libraries.lang,
2424
libraries.protobuf
25-
testCompile libraries.guava_testlib,
25+
testCompile libraries.guava,
26+
libraries.guava_testlib,
2627
libraries.junit,
2728
libraries.mockito,
2829
libraries.truth
@@ -40,10 +41,3 @@ configureProtoCompilation()
4041
javadoc {
4142
exclude 'io/grpc/alts/internal/**'
4243
}
43-
44-
idea {
45-
module {
46-
sourceDirs += file("${projectDir}/src/generated/main/grpc");
47-
sourceDirs += file("${projectDir}/src/generated/main/java");
48-
}
49-
}

alts/src/main/java/io/grpc/alts/AltsServerBuilder.java

+6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package io.grpc.alts;
1818

19+
import com.google.common.base.MoreObjects;
1920
import io.grpc.BindableService;
2021
import io.grpc.CompressorRegistry;
2122
import io.grpc.DecompressorRegistry;
@@ -248,5 +249,10 @@ public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedE
248249
public void awaitTermination() throws InterruptedException {
249250
delegate.awaitTermination();
250251
}
252+
253+
@Override
254+
public String toString() {
255+
return MoreObjects.toStringHelper(this).add("delegate", delegate).toString();
256+
}
251257
}
252258
}

alts/src/test/java/io/grpc/alts/internal/AesGcmHkdfAeadCrypterTest.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818

1919
import static com.google.common.truth.Truth.assertWithMessage;
2020

21+
import com.google.common.io.BaseEncoding;
2122
import java.nio.ByteBuffer;
2223
import java.security.GeneralSecurityException;
2324
import java.util.Arrays;
24-
import javax.xml.bind.DatatypeConverter;
2525
import org.junit.Test;
2626
import org.junit.runner.RunWith;
2727
import org.junit.runners.JUnit4;
@@ -78,27 +78,27 @@ TestVectorBuilder withComment(String comment) {
7878
}
7979

8080
TestVectorBuilder withKey(String key) {
81-
this.key = DatatypeConverter.parseHexBinary(key);
81+
this.key = BaseEncoding.base16().lowerCase().decode(key);
8282
return this;
8383
}
8484

8585
TestVectorBuilder withNonce(String nonce) {
86-
this.nonce = DatatypeConverter.parseHexBinary(nonce);
86+
this.nonce = BaseEncoding.base16().lowerCase().decode(nonce);
8787
return this;
8888
}
8989

9090
TestVectorBuilder withAad(String aad) {
91-
this.aad = DatatypeConverter.parseHexBinary(aad);
91+
this.aad = BaseEncoding.base16().lowerCase().decode(aad);
9292
return this;
9393
}
9494

9595
TestVectorBuilder withPlaintext(String plaintext) {
96-
this.plaintext = DatatypeConverter.parseHexBinary(plaintext);
96+
this.plaintext = BaseEncoding.base16().lowerCase().decode(plaintext);
9797
return this;
9898
}
9999

100100
TestVectorBuilder withCiphertext(String ciphertext) {
101-
this.ciphertext = DatatypeConverter.parseHexBinary(ciphertext);
101+
this.ciphertext = BaseEncoding.base16().lowerCase().decode(ciphertext);
102102
return this;
103103
}
104104
}

benchmarks/build.gradle

+1-10
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ dependencies {
3737
libraries.netty_tcnative,
3838
libraries.netty_epoll,
3939
libraries.math
40+
compileOnly libraries.javax_annotation
4041
}
4142

4243
compileJava {
@@ -72,7 +73,6 @@ task openloop_client(type: CreateStartScripts) {
7273
task qps_server(type: CreateStartScripts) {
7374
mainClassName = "io.grpc.benchmarks.qps.AsyncServer"
7475
applicationName = "qps_server"
75-
defaultJvmOpts = ["-javaagent:" + configurations.alpnagent.asPath] + vmArgs
7676
outputDir = new File(project.buildDir, 'tmp')
7777
classpath = jar.outputs.files + project.configurations.runtime
7878
}
@@ -92,12 +92,3 @@ applicationDistribution.into("bin") {
9292
from(benchmark_worker)
9393
fileMode = 0755
9494
}
95-
96-
// Let intellij projects refer to generated code
97-
idea {
98-
module {
99-
sourceDirs += file("${projectDir}/src/generated/main/java");
100-
sourceDirs += file("${projectDir}/src/generated/main/grpc");
101-
}
102-
}
103-

benchmarks/src/generated/main/java/io/grpc/benchmarks/proto/Services.java

+22-25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)