Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

Commit a7952b6

Browse files
committed
fix
1 parent f767983 commit a7952b6

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -526,12 +526,12 @@ static class Entry {
526526
* start.
527527
*/
528528
@VisibleForTesting final AtomicInteger outstandingUnaryRpcs = new AtomicInteger(0);
529+
529530
@VisibleForTesting final AtomicInteger outstandingStreamingRpcs = new AtomicInteger(0);
530531

531532
private final AtomicInteger maxOutstandingUnaryRpcs = new AtomicInteger();
532533
private final AtomicInteger maxOutstandingStreamingRpcs = new AtomicInteger();
533534

534-
535535
/** Queue storing the last 5 minutes of probe results */
536536
@VisibleForTesting
537537
final ConcurrentLinkedQueue<ProbeResult> probeHistory = new ConcurrentLinkedQueue<>();
@@ -557,6 +557,7 @@ static class Entry {
557557
ManagedChannel getManagedChannel() {
558558
return this.channel;
559559
}
560+
560561
@VisibleForTesting
561562
int totalOutstandingRpcs() {
562563
return outstandingUnaryRpcs.get() + outstandingStreamingRpcs.get();
@@ -579,7 +580,8 @@ int getAndResetMaxOutstanding() {
579580
@VisibleForTesting
580581
boolean retain(boolean isStreaming) {
581582
AtomicInteger counter = isStreaming ? outstandingStreamingRpcs : outstandingUnaryRpcs;
582-
AtomicInteger maxCounter = isStreaming ? maxOutstandingStreamingRpcs : maxOutstandingUnaryRpcs;
583+
AtomicInteger maxCounter =
584+
isStreaming ? maxOutstandingStreamingRpcs : maxOutstandingUnaryRpcs;
583585
int currentOutstanding = counter.incrementAndGet();
584586
maxCounter.accumulateAndGet(currentOutstanding, Math::max);
585587
// abort if the channel is closing
@@ -601,13 +603,12 @@ void release(boolean isStreaming) {
601603
LOG.log(Level.WARNING, "Bug! Reference count is negative (" + newCount + ")!");
602604
}
603605

604-
// Must check toalOutstandingRpcs after shutdownRequested (in reverse order of retain()) to ensure
606+
// Must check toalOutstandingRpcs after shutdownRequested (in reverse order of retain()) to
607+
// ensure
605608
// mutual exclusion.
606609
if (shutdownRequested.get() && totalOutstandingRpcs() == 0) {
607610
shutdown();
608611
}
609-
610-
611612
}
612613

613614
/**
@@ -647,7 +648,8 @@ public <RequestT, ResponseT> ClientCall<RequestT, ResponseT> newCall(
647648
MethodDescriptor<RequestT, ResponseT> methodDescriptor, CallOptions callOptions) {
648649
boolean isStreaming = methodDescriptor.getType() != MethodDescriptor.MethodType.UNARY;
649650
Entry entry = getRetainedEntry(index, isStreaming);
650-
return new ReleasingClientCall<>(entry.channel.newCall(methodDescriptor, callOptions), entry, isStreaming);
651+
return new ReleasingClientCall<>(
652+
entry.channel.newCall(methodDescriptor, callOptions), entry, isStreaming);
651653
}
652654
}
653655

google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolSettingsTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@
1919

2020
import com.google.api.gax.grpc.ChannelPoolSettings;
2121
import com.google.common.collect.ImmutableSet;
22+
import io.grpc.ManagedChannel;
2223
import java.lang.reflect.Method;
2324
import java.lang.reflect.Modifier;
2425
import java.util.Arrays;
2526
import java.util.Set;
2627
import java.util.stream.Collectors;
27-
28-
import io.grpc.ManagedChannel;
2928
import org.junit.Test;
3029
import org.junit.runner.RunWith;
3130
import org.junit.runners.JUnit4;
@@ -89,7 +88,6 @@ public void testEntryRetainReleaseByType() {
8988
assertThat(entry.totalOutstandingRpcs()).isEqualTo(0);
9089
}
9190

92-
9391
@Test
9492
public void testToBigtableChannelPoolSettingsDefaultValuesCopiesCorrectly() throws Exception {
9593
ChannelPoolSettings originalSettings = ChannelPoolSettings.builder().build();

0 commit comments

Comments
 (0)