Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/grpc/grpc-java into ot-re…
Browse files Browse the repository at this point in the history
…al-tracing
  • Loading branch information
YifeiZhuang committed Aug 15, 2024
2 parents 89b63d2 + 6dbd1b9 commit 1e8f42b
Show file tree
Hide file tree
Showing 208 changed files with 6,986 additions and 1,532 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,17 @@ jobs:
- name: Run bazel build
run: bazelisk build //... --enable_bzlmod=false

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

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

- name: Run example bazel build (bzlmod)
env:
USE_BAZEL_VERSION: 7.0.0
run: bazelisk build //... --enable_bzlmod=true
working-directory: ./examples
57 changes: 25 additions & 32 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,43 +30,36 @@ style configurations are commonly useful. For IntelliJ 14, copy the style to
`~/.IdeaIC14/config/codestyles/`, start IntelliJ, go to File > Settings > Code
Style, and set the Scheme to `GoogleStyle`.

## Maintaining clean commit history

We have few conventions for keeping history clean and making code reviews easier
for reviewers:

* First line of commit messages should be in format of

`package-name: summary of change`

where the summary finishes the sentence: `This commit improves gRPC to ____________.`

for example:

`core,netty,interop-testing: add capacitive duractance to turbo encabulators`

* Every time you receive a feedback on your pull request, push changes that
address it as a separate one or multiple commits with a descriptive commit
message (try avoid using vauge `addressed pr feedback` type of messages).

Project maintainers are obligated to squash those commits into one when
merging.

## Guidelines for Pull Requests
How to get your contributions merged smoothly and quickly.

- Create **small PRs** that are narrowly focused on **addressing a single concern**. We often times receive PRs that are trying to fix several things at a time, but only one fix is considered acceptable, nothing gets merged and both author's & review's time is wasted. Create more PRs to address different concerns and everyone will be happy.

- For speculative changes, consider opening an issue and discussing it first. If you are suggesting a behavioral or API change, consider starting with a [gRFC proposal](https://github.com/grpc/proposal).

- Provide a good **PR description** as a record of **what** change is being made and **why** it was made. Link to a github issue if it exists.

- Don't fix code style and formatting unless you are already changing that line to address an issue. PRs with irrelevant changes won't be merged. If you do want to fix formatting or style, do that in a separate PR.

- Unless your PR is trivial, you should expect there will be reviewer comments that you'll need to address before merging. We expect you to be reasonably responsive to those comments, otherwise the PR will be closed after 2-3 weeks of inactivity.

- Maintain **clean commit history** and use **meaningful commit messages**. See [maintaining clean commit history](#maintaining-clean-commit-history) for details.

- For speculative changes, consider opening an issue and discussing it to avoid
wasting time on an inappropriate approach. If you are suggesting a behavioral
or API change, consider starting with a [gRFC
proposal](https://github.com/grpc/proposal).

- Follow [typical Git commit message](https://cbea.ms/git-commit/#seven-rules)
structure. Have a good **commit description** as a record of **what** and
**why** the change is being made. Link to a GitHub issue if it exists. The
commit description makes a good PR description and is auto-copied by GitHub if
you have a single commit when creating the PR.

If your change is mostly for a single module (e.g., other module changes are
trivial), prefix your commit summary with the module name changed. Instead of
"Add HTTP/2 faster-than-light support to gRPC Netty" it is more terse as
"netty: Add faster-than-light support".

- Don't fix code style and formatting unless you are already changing that line
to address an issue. If you do want to fix formatting or style, do that in a
separate PR.

- Unless your PR is trivial, you should expect there will be reviewer comments
that you'll need to address before merging. Address comments with additional
commits so the reviewer can review just the changes; do not squash reviewed
commits unless the reviewer agrees. PRs are squashed when merging.

- Keep your PR up to date with upstream/master (if there are merge conflicts, we can't really merge your change).

- **All tests need to be passing** before your change can be merged. We recommend you **run tests locally** before creating your PR to catch breakages early on. Also, `./gradlew build` (`gradlew build` on Windows) **must not introduce any new warnings**.
Expand Down
26 changes: 13 additions & 13 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ for general contribution guidelines.
- [larry-safran](https://github.com/larry-safran), Google LLC
- [markb74](https://github.com/markb74), Google LLC
- [ran-su](https://github.com/ran-su), Google LLC
- [sanjaypujare](https://github.com/sanjaypujare), Google LLC
- [sergiitk](https://github.com/sergiitk), Google LLC
- [temawi](https://github.com/temawi), Google LLC
- [YifeiZhuang](https://github.com/YifeiZhuang), Google LLC
- [zhangkun83](https://github.com/zhangkun83), Google LLC

## Emeritus Maintainers (in alphabetical order)
- [carl-mastrangelo](https://github.com/carl-mastrangelo), Google LLC
- [creamsoup](https://github.com/creamsoup), Google LLC
- [dapengzhang0](https://github.com/dapengzhang0), Google LLC
- [ericgribkoff](https://github.com/ericgribkoff), Google LLC
- [jiangtaoli2016](https://github.com/jiangtaoli2016), Google LLC
- [jtattermusch](https://github.com/jtattermusch), Google LLC
- [louiscryan](https://github.com/louiscryan), Google LLC
- [nicolasnoble](https://github.com/nicolasnoble), Google LLC
- [nmittler](https://github.com/nmittler), Google LLC
- [srini100](https://github.com/srini100), Google LLC
- [voidzcy](https://github.com/voidzcy), Google LLC
- [zpencer](https://github.com/zpencer), Google LLC
- [carl-mastrangelo](https://github.com/carl-mastrangelo)
- [creamsoup](https://github.com/creamsoup)
- [dapengzhang0](https://github.com/dapengzhang0)
- [ericgribkoff](https://github.com/ericgribkoff)
- [jiangtaoli2016](https://github.com/jiangtaoli2016)
- [jtattermusch](https://github.com/jtattermusch)
- [louiscryan](https://github.com/louiscryan)
- [nicolasnoble](https://github.com/nicolasnoble)
- [nmittler](https://github.com/nmittler)
- [sanjaypujare](https://github.com/sanjaypujare)
- [srini100](https://github.com/srini100)
- [voidzcy](https://github.com/voidzcy)
- [zpencer](https://github.com/zpencer)
35 changes: 17 additions & 18 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module(
name = "grpc-java",
compatibility_level = 0,
repo_name = "io_grpc_grpc_java",
version = "0",
version = "1.67.0-SNAPSHOT", # CURRENT_GRPC_VERSION
)

# GRPC_DEPS_START
Expand All @@ -22,20 +22,20 @@ IO_GRPC_GRPC_JAVA_ARTIFACTS = [
"com.google.truth:truth:1.4.2",
"com.squareup.okhttp:okhttp:2.7.5",
"com.squareup.okio:okio:2.10.0", # 3.0+ needs swapping to -jvm; need work to avoid flag-day
"io.netty:netty-buffer:4.1.100.Final",
"io.netty:netty-codec-http2:4.1.100.Final",
"io.netty:netty-codec-http:4.1.100.Final",
"io.netty:netty-codec-socks:4.1.100.Final",
"io.netty:netty-codec:4.1.100.Final",
"io.netty:netty-common:4.1.100.Final",
"io.netty:netty-handler-proxy:4.1.100.Final",
"io.netty:netty-handler:4.1.100.Final",
"io.netty:netty-resolver:4.1.100.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.100.Final",
"io.netty:netty-transport-native-unix-common:4.1.100.Final",
"io.netty:netty-transport:4.1.100.Final",
"io.netty:netty-buffer:4.1.110.Final",
"io.netty:netty-codec-http2:4.1.110.Final",
"io.netty:netty-codec-http:4.1.110.Final",
"io.netty:netty-codec-socks:4.1.110.Final",
"io.netty:netty-codec:4.1.110.Final",
"io.netty:netty-common:4.1.110.Final",
"io.netty:netty-handler-proxy:4.1.110.Final",
"io.netty:netty-handler:4.1.110.Final",
"io.netty:netty-resolver:4.1.110.Final",
"io.netty:netty-tcnative-boringssl-static:2.0.65.Final",
"io.netty:netty-tcnative-classes:2.0.65.Final",
"io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.110.Final",
"io.netty:netty-transport-native-unix-common:4.1.110.Final",
"io.netty:netty-transport:4.1.110.Final",
"io.opencensus:opencensus-api:0.31.0",
"io.opencensus:opencensus-contrib-grpc-metrics:0.31.0",
"io.perfmark:perfmark-api:0.27.0",
Expand All @@ -47,6 +47,8 @@ IO_GRPC_GRPC_JAVA_ARTIFACTS = [

bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "googleapis", repo_name = "com_google_googleapis", version = "0.0.0-20240326-1c8d509c5")
# CEL Spec may be removed when cncf/xds MODULE is no longer using protobuf 27.x
bazel_dep(name = "cel-spec", repo_name = "dev_cel", version = "0.15.0")
bazel_dep(name = "grpc", repo_name = "com_github_grpc_grpc", version = "1.56.3.bcr.1")
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")
Expand All @@ -62,7 +64,6 @@ use_repo(
non_module_deps,
"com_github_cncf_xds",
"envoy_api",
"com_google_protobuf_javalite",
)

grpc_repo_deps_ext = use_extension("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_repo_deps_ext")
Expand Down Expand Up @@ -203,5 +204,3 @@ maven.override(
switched_rules = use_extension("@com_google_googleapis//:extensions.bzl", "switched_rules")

switched_rules.use_languages(java = True)

use_repo(switched_rules, "com_google_googleapis_imports")
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.65.0/examples) and the
[Android example](https://github.com/grpc/grpc-java/tree/v1.65.0/examples/android)
The [examples](https://github.com/grpc/grpc-java/tree/v1.66.0/examples) and the
[Android example](https://github.com/grpc/grpc-java/tree/v1.66.0/examples/android)
are standalone projects that showcase the usage of gRPC.

Download
Expand All @@ -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.65.0</version>
<version>1.66.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>1.65.0</version>
<version>1.66.0</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>1.65.0</version>
<version>1.66.0</version>
</dependency>
<dependency> <!-- necessary for Java 9+ -->
<groupId>org.apache.tomcat</groupId>
Expand All @@ -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.65.0'
implementation 'io.grpc:grpc-protobuf:1.65.0'
implementation 'io.grpc:grpc-stub:1.65.0'
runtimeOnly 'io.grpc:grpc-netty-shaded:1.66.0'
implementation 'io.grpc:grpc-protobuf:1.66.0'
implementation 'io.grpc:grpc-stub:1.66.0'
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.65.0'
implementation 'io.grpc:grpc-protobuf-lite:1.65.0'
implementation 'io.grpc:grpc-stub:1.65.0'
implementation 'io.grpc:grpc-okhttp:1.66.0'
implementation 'io.grpc:grpc-protobuf-lite:1.66.0'
implementation 'io.grpc:grpc-stub:1.66.0'
compileOnly 'org.apache.tomcat:annotations-api:6.0.53' // necessary for Java 9+
```

Expand All @@ -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.65.0
https://search.maven.org/search?q=g:io.grpc%20AND%20v:1.66.0

Development snapshots are available in [Sonatypes's snapshot
repository](https://oss.sonatype.org/content/repositories/snapshots/).
Expand Down Expand Up @@ -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.1:exe:${os.detected.classifier}</protocArtifact>
<protocArtifact>com.google.protobuf:protoc:3.25.3:exe:${os.detected.classifier}</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.65.0:exe:${os.detected.classifier}</pluginArtifact>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.66.0:exe:${os.detected.classifier}</pluginArtifact>
</configuration>
<executions>
<execution>
Expand All @@ -157,11 +157,11 @@ plugins {
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.25.1"
artifact = "com.google.protobuf:protoc:3.25.3"
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.65.0'
artifact = 'io.grpc:protoc-gen-grpc-java:1.66.0'
}
}
generateProtoTasks {
Expand Down Expand Up @@ -190,11 +190,11 @@ plugins {
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.25.1"
artifact = "com.google.protobuf:protoc:3.25.3"
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.65.0'
artifact = 'io.grpc:protoc-gen-grpc-java:1.66.0'
}
}
generateProtoTasks {
Expand Down
2 changes: 2 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ them before continuing, and set them again when resuming.
```bash
MAJOR=1 MINOR=7 PATCH=0 # Set appropriately for new release
VERSION_FILES=(
MODULE.bazel
build.gradle
core/src/main/java/io/grpc/internal/GrpcUtil.java
examples/MODULE.bazel
examples/build.gradle
examples/pom.xml
examples/android/clientcache/app/build.gradle
Expand Down
3 changes: 2 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,8 @@ grpc-netty version | netty-handler version | netty-tcnative-boringssl-static ver
1.56.x | 4.1.87.Final | 2.0.61.Final
1.57.x-1.58.x | 4.1.93.Final | 2.0.61.Final
1.59.x | 4.1.97.Final | 2.0.61.Final
1.60.x- | 4.1.100.Final | 2.0.61.Final
1.60.x-1.66.x | 4.1.100.Final | 2.0.61.Final
1.67.x | 4.1.110.Final | 2.0.65.Final

_(grpc-netty-shaded avoids issues with keeping these versions in sync.)_

Expand Down
2 changes: 0 additions & 2 deletions alts/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ java_library(
"@com_google_protobuf//:protobuf_java_util",
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.guava:guava"),
artifact("com.google.j2objc:j2objc-annotations"),
artifact("io.netty:netty-buffer"),
artifact("io.netty:netty-codec"),
artifact("io.netty:netty-common"),
Expand All @@ -45,7 +44,6 @@ java_library(
artifact("com.google.auth:google-auth-library-oauth2-http"),
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.guava:guava"),
artifact("com.google.j2objc:j2objc-annotations"),
artifact("io.netty:netty-common"),
artifact("io.netty:netty-handler"),
artifact("io.netty:netty-transport"),
Expand Down
1 change: 0 additions & 1 deletion android-interop-testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ import net.ltgt.gradle.errorprone.CheckSeverity
tasks.withType(JavaCompile).configureEach {
options.compilerArgs += [
"-Xlint:-cast",
"-Xlint:-deprecation", // https://github.com/grpc/grpc-java/issues/10298
]
appendToProperty(it.options.errorprone.excludedPaths, ".*/R.java", "|")
appendToProperty(
Expand Down
1 change: 0 additions & 1 deletion api/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ java_library(
artifact("com.google.errorprone:error_prone_annotations"),
artifact("com.google.guava:failureaccess"), # future transitive dep of Guava. See #5214
artifact("com.google.guava:guava"),
artifact("com.google.j2objc:j2objc-annotations"),
],
)
14 changes: 14 additions & 0 deletions api/src/main/java/io/grpc/LoadBalancer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1526,5 +1526,19 @@ public PickResult pickSubchannel(PickSubchannelArgs args) {
public String toString() {
return "FixedResultPicker(" + result + ")";
}

@Override
public int hashCode() {
return result.hashCode();
}

@Override
public boolean equals(Object o) {
if (!(o instanceof FixedResultPicker)) {
return false;
}
FixedResultPicker that = (FixedResultPicker) o;
return this.result.equals(that.result);
}
}
}
2 changes: 1 addition & 1 deletion api/src/main/java/io/grpc/Metadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

package io.grpc;

import static com.google.common.base.Charsets.US_ASCII;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static java.nio.charset.StandardCharsets.US_ASCII;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
Expand Down
11 changes: 11 additions & 0 deletions api/src/main/java/io/grpc/NameResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,17 @@ public final void onAddresses(
*/
@Override
public abstract void onError(Status error);

/**
* Handles updates on resolved addresses and attributes.
*
* @param resolutionResult the resolved server addresses, attributes, and Service Config.
* @since 1.66
*/
public Status onResult2(ResolutionResult resolutionResult) {
onResult(resolutionResult);
return Status.OK;
}
}

/**
Expand Down
Loading

0 comments on commit 1e8f42b

Please sign in to comment.