-
Notifications
You must be signed in to change notification settings - Fork 605
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
pubsub: convert to grpc #1070
pubsub: convert to grpc #1070
Conversation
|
||
service[protoOpts.method](snakeize(reqOpts), function(err, resp) { | ||
if (err) { | ||
var HTTP_ERROR_CODE_MAP = { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
What are your thoughts on instead of adding conditionals to check whether or not we should be using grpc or request, we instead made additional classes that extend If possible I think it might provide us with a cleaner separation of logic and potentially less of the actual service (in this case Just throwing it out there, TBH I'm not even sure if it would work since I'm still going through the code. :) |
That sounds good to me! |
// out around 90 seconds. Allow an extra couple of seconds to give the API a | ||
// chance to respond on its own before terminating the connection. | ||
var PUBSUB_API_TIMEOUT = 90000; | ||
this.timeout = PUBSUB_API_TIMEOUT + 2000; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@tbetbetbe - hello! I'm hoping you can take a look at how we're using gRPC here to make sure it's correct. I also have some general questions in my opening post for this PR that I could use some help with. Thanks, and if you have any questions, let me know! |
3dd733d
to
28dbca2
Compare
@callmehiphop - ptal! |
@stephenplusplus LGTM! |
this.grpcCredentials | ||
); | ||
|
||
service[protoOpts.method](snakeize(reqOpts), function(err, resp) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@murgatroid99 when I run our system tests, the output is pretty noisy:
Is this something that can be switched off? |
28dbca2
to
9cf1626
Compare
Those verbose logs shouldn't be output at all unless you have |
I don't recall setting those. I echo'd and no value was returned, but |
@murgatroid99 I had a friend try and he ran into the same problem:
Should I open an issue on gRPC? |
Yes, that would be helpful. On Tue, Feb 2, 2016, 8:10 AM Stephen Sawchuk [email protected]
|
grpc/grpc#5004 -- sorry to increment a repo with already greater than 5000 issues :( Thanks for your help, though! |
3a5a790
to
625b767
Compare
Still getting failures for this. Again, this doesn't look like a code issue, but rather the response for IAM comes back in object form vs strings for HTTP. |
Can you paste the errors? |
|
Confirmed on Node v0.12. This is an issue with |
Fixed in stephenplusplus@7811c4f - ptal |
@stephenplusplus looks like Travis is still choking on it |
Travis has been put in his place. |
56729ff
to
e904058
Compare
@stephenplusplus LGTM, let me know if there's anything else I can do to help. |
e904058
to
4825ecd
Compare
Cool, thanks! @tmatsuo is gRPC generally available for pubsub.googleapis.com? |
4825ecd
to
6243407
Compare
@callmehiphop this thing is ready to fly. |
*/ | ||
GrpcService.prototype.request = function(protoOpts, reqOpts, callback) { | ||
if (global.GCLOUD_TEST_ENVIRONMENT) { | ||
return global.GCLOUD_TEST_ENVIRONMENT; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
6243407
to
377439d
Compare
pubsub: convert to grpc
377439d
to
1bcc94d
Compare
This restores the fix from googleapis#1105 which was broken after googleapis#1070
This restores the fix from googleapis#1105 which was broken after googleapis#1070
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped)) | [`^16.0.0` -> `^18.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/16.18.3/18.11.9) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-vision). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4yNDEuMTEiLCJ1cGRhdGVkSW5WZXIiOiIzNC4xMS4xIn0=-->
Fixes #1104
RE: #1049
This adds support for gRPC APIs where necessary (Service & ServiceObject). This PR also converts Pub/Sub to use gRPC.
To Dos
Use grpc.status error maps- doesn't work, need HTTP status codes.deadline
for PubSub calls (pubsub: convert to grpc #1070 (comment))mockery
->mockery-next
Mockery wasn't holding up for our use of gRPC in this module. When trying to mock it in two different test suites, mockery couldn't handle it. I found mockery-next handles it quite well: cspotcode/mockery-next#6.
Mockery Next requires a more logical way of specifying the modules you want to stub (https://github.com/mfncooper/mockery/pull/25/files). That's why the enormous changes to just filepaths in almost every test file.