Skip to content

Commit eaa363e

Browse files
committed
Adjust for gRFC A61 update
1 parent 512d4a2 commit eaa363e

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ void processSubchannelState(SubchannelData subchannelData, ConnectivityStateInfo
294294
}
295295

296296
if (newState == IDLE && subchannelData.state == READY) {
297+
numTf = 0;
297298
helper.refreshNameResolution();
298299
}
299300

@@ -336,9 +337,6 @@ void processSubchannelState(SubchannelData subchannelData, ConnectivityStateInfo
336337
shutdownRemaining(subchannelData);
337338
addressIndex.seekTo(getAddress(subchannelData.subchannel));
338339
rawConnectivityState = READY;
339-
// Reset for clarity, but isPassComplete() prevents any counts currently present from being
340-
// read until they point they no longer matter
341-
numTf = 0;
342340
updateHealthCheckedState(subchannelData);
343341
break;
344342

@@ -370,10 +368,8 @@ void processSubchannelState(SubchannelData subchannelData, ConnectivityStateInfo
370368

371369
// Refresh Name Resolution, but only when all 3 conditions are met
372370
// * We are at the end of addressIndex
373-
// * have had status reported for all subchannels.
374-
// * And one of the following conditions:
375-
// * Have had enough TF reported since we completed first pass
376-
// * Just completed the first pass (in which case enough TF have been reported)
371+
// * Have had status reported for all subchannels.
372+
// * Have had enough TF reported since the last refresh
377373
if (numTf >= addressIndex.size()) {
378374
numTf = 0;
379375
helper.refreshNameResolution();

0 commit comments

Comments
 (0)