-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api: When forwarding from Listener onAddresses to Listener2 continue to use onResult #11666
Conversation
…ization context to call it from inside of the synchronization context. Fixes grpc#11662.
Collections.singletonList(new EquivalentAddressGroup(address)))) | ||
.setAttributes(Attributes.EMPTY) | ||
.build()); | ||
args.getSynchronizationContext().execute(() -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why this was added. start()
should be called from the synchronization context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
@@ -58,7 +60,8 @@ private void resolve() { | |||
List<EquivalentAddressGroup> servers = new ArrayList<>(1); | |||
servers.add(new EquivalentAddressGroup(new DomainSocketAddress(authority))); | |||
resolutionResultBuilder.setAddressesOrError(StatusOr.fromValue(servers)); | |||
listener.onResult2(resolutionResultBuilder.build()); | |||
args.getSynchronizationContext().execute(() -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was also fine, because start() and refresh() are called from the synchronization context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
…d from sync context.
Fixes #11662 |
When forwarding from Listener onAddresses to Listener2 continue to use onResult and not onResult2 because the latter requires to be called from within synchronization context and it breaks existing code that didn't need to do so when using the old Listener interface.