Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
270567d
core: Added changes to DelayedStream.setStream() should cancel the pr…
Sangamesh1997 Mar 19, 2025
072d033
Merge branch 'grpc:master' into Issue_fixed_1537
Sangamesh1997 Mar 19, 2025
8ac9678
core: Added changes to DelayedStream.setStream() should cancel the pr…
Sangamesh1997 Mar 20, 2025
cac52d4
core: Fixed internal review points
Sangamesh1997 Mar 21, 2025
00eb166
xds: Include XdsConfig as a CallOption
ejona86 Mar 18, 2025
8cd4d5a
xds: Assert XdsNR's cluster ref counting is consistent
ejona86 Mar 5, 2025
2295bbe
xds: Expose filter names to filter instances (#11971)
ejona86 Mar 21, 2025
9e6ece3
Replace usages of deprecated ExpectedException in grpc-api and grpc-c…
panchenko Mar 21, 2025
77216bf
otel tracing: fix span names (#11974)
YifeiZhuang Mar 21, 2025
d28fcb2
xds: add support for custom per-target credentials on the transport (…
AshZhang Mar 21, 2025
eeded6f
core: Log any exception during panic because of exception
ejona86 Mar 24, 2025
036cd41
services: Avoid cancellation exceptions when notifying watchers that …
JoeCqupt Mar 25, 2025
61bb878
fix: cleans up FileWatcherCertificateProvider in XdsSecurityClientSer…
AgraVator Mar 26, 2025
3a35a76
core: Use java.time.Time.getNano in InstantTimeProvider without refle…
panchenko Mar 26, 2025
fa77210
util: Graceful switch to new LB when leaving CONNECTING
ejona86 Mar 27, 2025
129e747
util: Replace BUFFER_PICKER with FixedResultPicker
ejona86 Mar 28, 2025
f828a3c
Start 1.73.0 development cycle (#11987)
AgraVator Apr 1, 2025
8c7cf53
okhttp: Per-rpc call option authority verification (#11754)
kannanjgithub Apr 2, 2025
8879e94
core: Delete stale SuppressWarnings("deprecated") for ATTR_LOAD_BALAN…
ejona86 Apr 2, 2025
920c384
core: Delete the long-deprecated GRPC_PROXY_EXP (#11988)
ejona86 Apr 2, 2025
0ab9e11
xds: propagate audience from cluster resource in gcp auth filter (#11…
shivaspeaks Apr 2, 2025
b7df168
core: Fixed internal review points
Sangamesh1997 Apr 3, 2025
58f39fa
core: Added changes to DelayedStream.setStream() should cancel the pr…
Sangamesh1997 Mar 19, 2025
013948d
core: Added changes to DelayedStream.setStream() should cancel the pr…
Sangamesh1997 Mar 20, 2025
a2220eb
core: Fixed internal review points
Sangamesh1997 Mar 21, 2025
67b2f3a
core: Fixed internal review points
Sangamesh1997 Apr 3, 2025
696dd52
Revert "core: Fixed internal review points"
Sangamesh1997 Apr 3, 2025
6beb245
Merge remote-tracking branch 'origin/Issue_fixed_1537' into Issue_fix…
Sangamesh1997 Apr 3, 2025
17e6b41
Merge branch 'master' into Issue_fixed_1537
Sangamesh1997 Apr 3, 2025
d1602ad
core: Fixed internal review points
Sangamesh1997 Apr 3, 2025
163c958
Merge branch 'grpc:master' into Issue_fixed_1537
Sangamesh1997 Apr 9, 2025
11adf6f
Merge branch 'grpc:master' into Issue_fixed_1537
Sangamesh1997 Apr 19, 2025
529a75e
Merge branch 'grpc:master' into Issue_fixed_1537
Sangamesh1997 Apr 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
util: Replace BUFFER_PICKER with FixedResultPicker
I think at some point there were more usages in the tests. But now it
is pretty easy.

PriorityLb.ChildLbState.picker is initialized to
FixedResultPicker(NoResult). So now that GracefulSwitchLb is using the
same picker, equals() is able to de-dup an update.
  • Loading branch information
ejona86 authored and Sangamesh1997 committed Apr 3, 2025
commit 129e7479de7e252d89a42b346f8032b02fa71ea5
16 changes: 1 addition & 15 deletions util/src/main/java/io/grpc/util/GracefulSwitchLoadBalancer.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import io.grpc.ConnectivityState;
Expand Down Expand Up @@ -66,19 +65,6 @@ public void handleNameResolutionError(final Status error) {
public void shutdown() {}
};

@VisibleForTesting
static final SubchannelPicker BUFFER_PICKER = new SubchannelPicker() {
@Override
public PickResult pickSubchannel(PickSubchannelArgs args) {
return PickResult.withNoResult();
}

@Override
public String toString() {
return "BUFFER_PICKER";
}
};

private final Helper helper;

// While the new policy is not fully switched on, the pendingLb is handling new updates from name
Expand Down Expand Up @@ -128,7 +114,7 @@ private void switchToInternal(LoadBalancer.Factory newBalancerFactory) {
pendingLb = defaultBalancer;
pendingBalancerFactory = null;
pendingState = ConnectivityState.CONNECTING;
pendingPicker = BUFFER_PICKER;
pendingPicker = new FixedResultPicker(PickResult.withNoResult());

if (newBalancerFactory.equals(currentBalancerFactory)) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import static io.grpc.ConnectivityState.IDLE;
import static io.grpc.ConnectivityState.READY;
import static io.grpc.ConnectivityState.TRANSIENT_FAILURE;
import static io.grpc.util.GracefulSwitchLoadBalancer.BUFFER_PICKER;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.inOrder;
Expand Down Expand Up @@ -521,7 +520,11 @@ public void switchWhileOldPolicyGoesFromReadyToNotReadyWhileNewPolicyStillIdle()
helper0.updateBalancingState(CONNECTING, picker);

verify(mockHelper, never()).updateBalancingState(CONNECTING, picker);
inOrder.verify(mockHelper).updateBalancingState(CONNECTING, BUFFER_PICKER);
ArgumentCaptor<SubchannelPicker> pickerCaptor = ArgumentCaptor.forClass(SubchannelPicker.class);
inOrder.verify(mockHelper).updateBalancingState(eq(CONNECTING), pickerCaptor.capture());
assertThat(pickerCaptor.getValue().pickSubchannel(mock(PickSubchannelArgs.class)).hasResult())
.isFalse();

inOrder.verify(lb0).shutdown(); // shutdown after update

picker = mock(SubchannelPicker.class);
Expand Down
9 changes: 4 additions & 5 deletions xds/src/test/java/io/grpc/xds/PriorityLoadBalancerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,7 @@ public void connectingResetFailOverIfSeenReadyOrIdleSinceTransientFailure() {
.setLoadBalancingPolicyConfig(priorityLbConfig)
.build());
// Nothing important about this verify, other than to provide a baseline
verify(helper, times(2))
.updateBalancingState(eq(CONNECTING), pickerReturns(PickResult.withNoResult()));
verify(helper).updateBalancingState(eq(CONNECTING), pickerReturns(PickResult.withNoResult()));
assertThat(fooBalancers).hasSize(1);
assertThat(fooHelpers).hasSize(1);
Helper helper0 = Iterables.getOnlyElement(fooHelpers);
Expand All @@ -539,7 +538,7 @@ public void connectingResetFailOverIfSeenReadyOrIdleSinceTransientFailure() {
helper0.updateBalancingState(
CONNECTING,
EMPTY_PICKER);
verify(helper, times(3))
verify(helper, times(2))
.updateBalancingState(eq(CONNECTING), pickerReturns(PickResult.withNoResult()));

// failover happens
Expand Down Expand Up @@ -805,7 +804,7 @@ public void raceBetweenShutdownAndChildLbBalancingStateUpdate() {
.setAddresses(ImmutableList.<EquivalentAddressGroup>of())
.setLoadBalancingPolicyConfig(priorityLbConfig)
.build());
verify(helper, times(2)).updateBalancingState(eq(CONNECTING), isA(SubchannelPicker.class));
verify(helper).updateBalancingState(eq(CONNECTING), isA(SubchannelPicker.class));

// LB shutdown and subchannel state change can happen simultaneously. If shutdown runs first,
// any further balancing state update should be ignored.
Expand Down Expand Up @@ -843,7 +842,7 @@ public void noDuplicateOverallBalancingStateUpdate() {
.setLoadBalancingPolicyConfig(priorityLbConfig)
.build());

verify(helper, times(6)).updateBalancingState(any(), any());
verify(helper, times(4)).updateBalancingState(any(), any());
}

private void assertLatestConnectivityState(ConnectivityState expectedState) {
Expand Down