Skip to content

Commit

Permalink
Merge branch 'grpc:v1.67.x' into v1.67.x
Browse files Browse the repository at this point in the history
  • Loading branch information
shivaspeaks authored Sep 17, 2024
2 parents 0ac607d + e821d5e commit da45ae5
Show file tree
Hide file tree
Showing 54 changed files with 2,222 additions and 780 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ jobs:
name: "Gradle wrapper validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v4
2 changes: 1 addition & 1 deletion .github/workflows/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v4
- uses: dessant/lock-threads@v5
with:
github-token: ${{ github.token }}
issue-inactive-days: 90
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ jobs:
fail-fast: false # Should swap to true if we grow a large matrix

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jre }}
distribution: 'temurin'

- name: Gradle cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
Expand All @@ -37,7 +37,7 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Maven cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.m2/repository
Expand All @@ -46,7 +46,7 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-
- name: Protobuf cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/protobuf-cache
key: ${{ runner.os }}-maven-${{ hashFiles('buildscripts/make_dependencies.sh') }}
Expand All @@ -55,7 +55,7 @@ jobs:
run: buildscripts/kokoro/unix.sh
- name: Post Failure Upload Test Reports to Artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Test Reports (JRE ${{ matrix.jre }})
path: |
Expand All @@ -71,23 +71,25 @@ jobs:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: ./gradlew :grpc-all:coveralls -PskipAndroid=true -x compileJava
- name: Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

bazel:
runs-on: ubuntu-latest
env:
USE_BAZEL_VERSION: 6.0.0

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Check versions match in MODULE.bazel and repositories.bzl
run: |
diff -u <(sed -n '/GRPC_DEPS_START/,/GRPC_DEPS_END/ {/GRPC_DEPS_/! p}' MODULE.bazel) \
<(sed -n '/GRPC_DEPS_START/,/GRPC_DEPS_END/ {/GRPC_DEPS_/! p}' repositories.bzl)
- name: Bazel cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cache/bazel/*/cache
Expand Down
5 changes: 0 additions & 5 deletions android-interop-testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ dependencies {

implementation project(':grpc-android'),
project(':grpc-core'),
project(':grpc-auth'),
project(':grpc-census'),
project(':grpc-okhttp'),
project(':grpc-protobuf-lite'),
Expand All @@ -81,10 +80,6 @@ dependencies {
libraries.androidx.test.rules,
libraries.opencensus.contrib.grpc.metrics

implementation (libraries.google.auth.oauth2Http) {
exclude group: 'org.apache.httpcomponents'
}

implementation (project(':grpc-services')) {
exclude group: 'com.google.protobuf'
exclude group: 'com.google.guava'
Expand Down
31 changes: 31 additions & 0 deletions api/src/main/java/io/grpc/InternalSubchannelAddressAttributes.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright 2024 The gRPC Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.grpc;

/**
* An internal class. Do not use.
*
* <p>An interface to provide the attributes for address connected by subchannel.
*/
@Internal
public interface InternalSubchannelAddressAttributes {

/**
* Return attributes of the server address connected by sub channel.
*/
public Attributes getConnectedAddressAttributes();
}
12 changes: 12 additions & 0 deletions api/src/main/java/io/grpc/LoadBalancer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1428,6 +1428,18 @@ public void updateAddresses(List<EquivalentAddressGroup> addrs) {
public Object getInternalSubchannel() {
throw new UnsupportedOperationException();
}

/**
* (Internal use only) returns attributes of the address subchannel is connected to.
*
* <p>Warning: this is INTERNAL API, is not supposed to be used by external users, and may
* change without notice. If you think you must use it, please file an issue and we can consider
* removing its "internal" status.
*/
@Internal
public Attributes getConnectedAddressAttributes() {
throw new UnsupportedOperationException();
}
}

/**
Expand Down
10 changes: 10 additions & 0 deletions core/src/main/java/io/grpc/internal/InternalSubchannel.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ protected void handleNotInUse() {

private Status shutdownReason;

private volatile Attributes connectedAddressAttributes;

InternalSubchannel(List<EquivalentAddressGroup> addressGroups, String authority, String userAgent,
BackoffPolicy.Provider backoffPolicyProvider,
ClientTransportFactory transportFactory, ScheduledExecutorService scheduledExecutor,
Expand Down Expand Up @@ -525,6 +527,13 @@ public void run() {
return channelStatsFuture;
}

/**
* Return attributes for server address connected by sub channel.
*/
public Attributes getConnectedAddressAttributes() {
return connectedAddressAttributes;
}

ConnectivityState getState() {
return state.getState();
}
Expand Down Expand Up @@ -568,6 +577,7 @@ public void run() {
} else if (pendingTransport == transport) {
activeTransport = transport;
pendingTransport = null;
connectedAddressAttributes = addressIndex.getCurrentEagAttributes();
gotoNonErrorState(READY);
}
}
Expand Down
5 changes: 5 additions & 0 deletions core/src/main/java/io/grpc/internal/ManagedChannelImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -2044,6 +2044,11 @@ public void updateAddresses(List<EquivalentAddressGroup> addrs) {
subchannel.updateAddresses(addrs);
}

@Override
public Attributes getConnectedAddressAttributes() {
return subchannel.getConnectedAddressAttributes();
}

private List<EquivalentAddressGroup> stripOverrideAuthorityAttributes(
List<EquivalentAddressGroup> eags) {
List<EquivalentAddressGroup> eagsWithoutOverrideAttr = new ArrayList<>();
Expand Down
Loading

0 comments on commit da45ae5

Please sign in to comment.