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

grpc-js: Client waitForReady callback fix. Fixes #1352 #1368

Merged
merged 3 commits into from
Apr 20, 2020

Conversation

badsyntax
Copy link
Contributor

@badsyntax badsyntax commented Apr 18, 2020

Fixes #1352

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Apr 18, 2020

CLA Check
The committers are authorized under a signed CLA.

@badsyntax
Copy link
Contributor Author

Change the commit messages to follow convention of grpc-js:

.EchoService as ServiceClientConstructor;

server = new Server();
server.addService(echoService.service, {
Copy link
Contributor Author

@badsyntax badsyntax Apr 18, 2020

Choose a reason for hiding this comment

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

Does this test rely on a service being added to the server? I don't think client.waitForReady depends on this, see:

Copy link
Member

Choose a reason for hiding this comment

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

No, waitForReady should not depend on the server having any services. In fact, the whole test file can be simplified significantly by omitting all of the protobuf stuff and directly using grpc.Client.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll simplify the tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've made that change.

…ixes grpc#1352

In the case where a new watcher is synchronously added to the watcher queue via the
watcher callback, this can result in the callback being called multiple times.

To support this case, the watcher needs to be move removed from the queue
before calling the watcher callback.
@badsyntax badsyntax changed the title Client waitforready fix. Fixes #1352 Client waitForReady callback fix. Fixes #1352 Apr 18, 2020
@badsyntax badsyntax marked this pull request as ready for review April 18, 2020 08:47
@badsyntax badsyntax changed the title Client waitForReady callback fix. Fixes #1352 grpc-js: Client waitForReady callback fix. Fixes #1352 Apr 18, 2020
No need to add a service to the server to test the client.
@murgatroid99
Copy link
Member

Thank you for your contribution.

@murgatroid99 murgatroid99 merged commit 8b16b3b into grpc:master Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

grpc-js: waitForReady called multiple times
3 participants