Skip to content

Commit d882a00

Browse files
committed
Remove unnecessary changes as start and resolve etc are already called from sync context.
1 parent 75719be commit d882a00

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -878,14 +878,13 @@ public String getServiceAuthority() {
878878

879879
@Override
880880
public void start(Listener2 listener) {
881-
args.getSynchronizationContext().execute(() ->
882-
listener.onResult2(
883-
ResolutionResult.newBuilder()
884-
.setAddressesOrError(
885-
StatusOr.fromValue(
886-
Collections.singletonList(new EquivalentAddressGroup(address))))
887-
.setAttributes(Attributes.EMPTY)
888-
.build()));
881+
listener.onResult2(
882+
ResolutionResult.newBuilder()
883+
.setAddressesOrError(
884+
StatusOr.fromValue(
885+
Collections.singletonList(new EquivalentAddressGroup(address))))
886+
.setAttributes(Attributes.EMPTY)
887+
.build());
889888
}
890889

891890
@Override

netty/src/main/java/io/grpc/netty/UdsNameResolver.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,10 @@
3030
final class UdsNameResolver extends NameResolver {
3131
private NameResolver.Listener2 listener;
3232
private final String authority;
33-
private final Args args;
3433

3534
UdsNameResolver(String authority, String targetPath, Args args) {
3635
checkArgument(authority == null, "non-null authority not supported");
3736
this.authority = targetPath;
38-
this.args = args;
3937
}
4038

4139
@Override
@@ -60,8 +58,7 @@ private void resolve() {
6058
List<EquivalentAddressGroup> servers = new ArrayList<>(1);
6159
servers.add(new EquivalentAddressGroup(new DomainSocketAddress(authority)));
6260
resolutionResultBuilder.setAddressesOrError(StatusOr.fromValue(servers));
63-
args.getSynchronizationContext().execute(() ->
64-
listener.onResult2(resolutionResultBuilder.build()));
61+
listener.onResult2(resolutionResultBuilder.build());
6562
}
6663

6764
@Override

0 commit comments

Comments
 (0)