Skip to content

Commit ec072b9

Browse files
Merge branch 'grpc:master' into Issue_fixed_6868
2 parents 63ac6f7 + d380191 commit ec072b9

File tree

59 files changed

+1443
-1567
lines changed

Some content is hidden

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

59 files changed

+1443
-1567
lines changed

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module(
22
name = "grpc-java",
33
compatibility_level = 0,
44
repo_name = "io_grpc_grpc_java",
5-
version = "1.76.0-SNAPSHOT", # CURRENT_GRPC_VERSION
5+
version = "1.77.0-SNAPSHOT", # CURRENT_GRPC_VERSION
66
)
77

88
# GRPC_DEPS_START

SECURITY.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -330,14 +330,10 @@ is an option](#tls-with-conscrypt). Otherwise you need to [build your own 32-bit
330330
version of
331331
`netty-tcnative`](https://netty.io/wiki/forked-tomcat-native.html#wiki-h2-6).
332332

333-
If on Alpine Linux and you see "Error loading shared library libcrypt.so.1: No
334-
such file or directory". Run `apk update && apk add libc6-compat` to install the
335-
necessary dependency.
336-
337-
If on Alpine Linux, try to use `grpc-netty-shaded` instead of `grpc-netty` or
338-
(if you need `grpc-netty`) `netty-tcnative-boringssl-static` instead of
339-
`netty-tcnative`. If those are not an option, you may consider using
340-
[netty-tcnative-alpine](https://github.com/pires/netty-tcnative-alpine).
333+
If on Alpine Linux, depending on your specific JDK you may see a crash in
334+
netty_tcnative. This is generally caused by a missing symbol. Run `apk install
335+
gcompat` and use the environment variable `LD_PRELOAD=/lib/libgcompat.so.0` when
336+
executing Java.
341337

342338
If on Fedora 30 or later and you see "libcrypt.so.1: cannot open shared object
343339
file: No such file or directory". Run `dnf -y install libxcrypt-compat` to

android/src/main/java/io/grpc/android/AndroidChannelBuilder.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,17 +323,15 @@ public void onBlockedStatusChanged(Network network, boolean blocked) {
323323

324324
/** Respond to network changes. Only used on API levels < 24. */
325325
private class NetworkReceiver extends BroadcastReceiver {
326-
private boolean isConnected = false;
327326

328327
@SuppressWarnings("deprecation")
329328
@Override
330329
public void onReceive(Context context, Intent intent) {
331330
ConnectivityManager conn =
332331
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
333332
android.net.NetworkInfo networkInfo = conn.getActiveNetworkInfo();
334-
boolean wasConnected = isConnected;
335-
isConnected = networkInfo != null && networkInfo.isConnected();
336-
if (isConnected && !wasConnected) {
333+
334+
if (networkInfo != null && networkInfo.isConnected()) {
337335
delegate.enterIdle();
338336
}
339337
}

android/src/test/java/io/grpc/android/AndroidChannelBuilderTest.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,6 @@ public void networkChanges_api23() {
152152
.sendBroadcast(new Intent(ConnectivityManager.CONNECTIVITY_ACTION));
153153
assertThat(delegateChannel.enterIdleCount).isEqualTo(1);
154154

155-
// The broadcast receiver may fire when the active network status has not actually changed
156-
ApplicationProvider
157-
.getApplicationContext()
158-
.sendBroadcast(new Intent(ConnectivityManager.CONNECTIVITY_ACTION));
159-
assertThat(delegateChannel.enterIdleCount).isEqualTo(1);
160-
161155
// Drop the connection
162156
shadowOf(connectivityManager).setActiveNetworkInfo(null);
163157
ApplicationProvider

api/src/main/java/io/grpc/ClientStreamTracer.java

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,15 @@ public static final class StreamInfo {
132132
private final CallOptions callOptions;
133133
private final int previousAttempts;
134134
private final boolean isTransparentRetry;
135+
private final boolean isHedging;
135136

136137
StreamInfo(
137-
CallOptions callOptions, int previousAttempts, boolean isTransparentRetry) {
138+
CallOptions callOptions, int previousAttempts, boolean isTransparentRetry,
139+
boolean isHedging) {
138140
this.callOptions = checkNotNull(callOptions, "callOptions");
139141
this.previousAttempts = previousAttempts;
140142
this.isTransparentRetry = isTransparentRetry;
143+
this.isHedging = isHedging;
141144
}
142145

143146
/**
@@ -165,6 +168,15 @@ public boolean isTransparentRetry() {
165168
return isTransparentRetry;
166169
}
167170

171+
/**
172+
* Whether the stream is hedging.
173+
*
174+
* @since 1.74.0
175+
*/
176+
public boolean isHedging() {
177+
return isHedging;
178+
}
179+
168180
/**
169181
* Converts this StreamInfo into a new Builder.
170182
*
@@ -174,7 +186,9 @@ public Builder toBuilder() {
174186
return new Builder()
175187
.setCallOptions(callOptions)
176188
.setPreviousAttempts(previousAttempts)
177-
.setIsTransparentRetry(isTransparentRetry);
189+
.setIsTransparentRetry(isTransparentRetry)
190+
.setIsHedging(isHedging);
191+
178192
}
179193

180194
/**
@@ -192,6 +206,7 @@ public String toString() {
192206
.add("callOptions", callOptions)
193207
.add("previousAttempts", previousAttempts)
194208
.add("isTransparentRetry", isTransparentRetry)
209+
.add("isHedging", isHedging)
195210
.toString();
196211
}
197212

@@ -204,6 +219,7 @@ public static final class Builder {
204219
private CallOptions callOptions = CallOptions.DEFAULT;
205220
private int previousAttempts;
206221
private boolean isTransparentRetry;
222+
private boolean isHedging;
207223

208224
Builder() {
209225
}
@@ -236,11 +252,21 @@ public Builder setIsTransparentRetry(boolean isTransparentRetry) {
236252
return this;
237253
}
238254

255+
/**
256+
* Sets whether the stream is hedging.
257+
*
258+
* @since 1.74.0
259+
*/
260+
public Builder setIsHedging(boolean isHedging) {
261+
this.isHedging = isHedging;
262+
return this;
263+
}
264+
239265
/**
240266
* Builds a new StreamInfo.
241267
*/
242268
public StreamInfo build() {
243-
return new StreamInfo(callOptions, previousAttempts, isTransparentRetry);
269+
return new StreamInfo(callOptions, previousAttempts, isTransparentRetry, isHedging);
244270
}
245271
}
246272
}

api/src/main/java/io/grpc/LoadBalancer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,9 +855,11 @@ public String toString() {
855855
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1771")
856856
public static final class Builder {
857857

858+
private static final Object[][] EMPTY_CUSTOM_OPTIONS = new Object[0][2];
859+
858860
private List<EquivalentAddressGroup> addrs;
859861
private Attributes attrs = Attributes.EMPTY;
860-
private Object[][] customOptions = new Object[0][2];
862+
private Object[][] customOptions = EMPTY_CUSTOM_OPTIONS;
861863

862864
Builder() {
863865
}

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ subprojects {
2121
apply plugin: "net.ltgt.errorprone"
2222

2323
group = "io.grpc"
24-
version = "1.76.0-SNAPSHOT" // CURRENT_GRPC_VERSION
24+
version = "1.77.0-SNAPSHOT" // CURRENT_GRPC_VERSION
2525

2626
plugins.withId("com.android.base") {
2727
android {

compiler/src/test/golden/TestDeprecatedService.java.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import static io.grpc.MethodDescriptor.generateFullMethodName;
88
* </pre>
99
*/
1010
@javax.annotation.Generated(
11-
value = "by gRPC proto compiler (version 1.76.0-SNAPSHOT)",
11+
value = "by gRPC proto compiler (version 1.77.0-SNAPSHOT)",
1212
comments = "Source: grpc/testing/compiler/test.proto")
1313
@io.grpc.stub.annotations.GrpcGenerated
1414
@java.lang.Deprecated

compiler/src/test/golden/TestService.java.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import static io.grpc.MethodDescriptor.generateFullMethodName;
88
* </pre>
99
*/
1010
@javax.annotation.Generated(
11-
value = "by gRPC proto compiler (version 1.76.0-SNAPSHOT)",
11+
value = "by gRPC proto compiler (version 1.77.0-SNAPSHOT)",
1212
comments = "Source: grpc/testing/compiler/test.proto")
1313
@io.grpc.stub.annotations.GrpcGenerated
1414
public final class TestServiceGrpc {

core/src/main/java/io/grpc/internal/ClientCallImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ public void runInContext() {
250250
stream = clientStreamProvider.newStream(method, callOptions, headers, context);
251251
} else {
252252
ClientStreamTracer[] tracers =
253-
GrpcUtil.getClientStreamTracers(callOptions, headers, 0, false);
253+
GrpcUtil.getClientStreamTracers(callOptions, headers, 0,
254+
false, false);
254255
String deadlineName = contextIsDeadlineSource ? "Context" : "CallOptions";
255256
Long nameResolutionDelay = callOptions.getOption(NAME_RESOLUTION_DELAYED);
256257
String description = String.format(

0 commit comments

Comments
 (0)