mirror of https://github.com/grpc/grpc-java.git
core: Apply ManagedChannelImpl's updateBalancingState() immediately
ffcc360ba
adjusted updateBalancingState() to require being run within
the sync context. However, it still queued the work into the sync
context, which was unnecessary. This re-entering the sync context
unnecessarily delays the new state from being used.
This commit is contained in:
parent
a6a041e415
commit
ca4819ac6d
|
@ -1388,9 +1388,7 @@ final class ManagedChannelImpl extends ManagedChannel implements
|
|||
syncContext.throwIfNotInThisSynchronizationContext();
|
||||
checkNotNull(newState, "newState");
|
||||
checkNotNull(newPicker, "newPicker");
|
||||
final class UpdateBalancingState implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
if (LbHelperImpl.this != lbHelper || panicMode) {
|
||||
return;
|
||||
}
|
||||
|
@ -1403,10 +1401,6 @@ final class ManagedChannelImpl extends ManagedChannel implements
|
|||
channelStateManager.gotoState(newState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
syncContext.execute(new UpdateBalancingState());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refreshNameResolution() {
|
||||
|
|
Loading…
Reference in New Issue