Skip to content
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, core: make scheduled executor service accessible for NameResolver.Args #6455

Conversation

voidzcy
Copy link
Contributor

@voidzcy voidzcy commented Nov 21, 2019

No description provided.

@@ -39,6 +40,7 @@
.setProxyDetector(mock(ProxyDetector.class))
.setSynchronizationContext(new SynchronizationContext(mock(UncaughtExceptionHandler.class)))
.setServiceConfigParser(mock(ServiceConfigParser.class))
.setScheduledExecutorService(mock(ScheduledExecutorService.class))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not leave unset?

@@ -116,6 +117,7 @@ public void uncaughtException(Thread t, Throwable e) {
.setProxyDetector(GrpcUtil.DEFAULT_PROXY_DETECTOR)
.setSynchronizationContext(syncContext)
.setServiceConfigParser(mock(ServiceConfigParser.class))
.setScheduledExecutorService(mock(ScheduledExecutorService.class))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one too. Is it necessary to set it? Can we leave it unset everywhere it is unused?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. It doesn't matter much. I set it just for completeness.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm mainly requesting it because it makes the tests more bug-prone. As it is now if the code starts using the scheduled executor service it will throw and then it is clear a FakeClock needs to be injected. With the mock it just silently doesn't do anything.

@voidzcy voidzcy merged commit eb21c64 into grpc:master Nov 22, 2019
ericgribkoff pushed a commit to ericgribkoff/grpc-java that referenced this pull request Dec 6, 2019
…r.Args (grpc#6455)

Added new API on NameResolver.Args to access ScheduledExecutorService, which is wrapped transport executor.
@lock lock bot locked as resolved and limited conversation to collaborators Feb 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants