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

Topic creation fails with DEADLINE_EXCEEDED error #1414

Closed
kirpichenko opened this issue Oct 27, 2021 · 7 comments · Fixed by #1416
Closed

Topic creation fails with DEADLINE_EXCEEDED error #1414

kirpichenko opened this issue Oct 27, 2021 · 7 comments · Fixed by #1416
Labels
api: pubsub Issues related to the googleapis/nodejs-pubsub API. type: question Request for information or clarification. Not an issue.

Comments

@kirpichenko
Copy link

We create topics like this

const client = new PubSub()
const topic = client.topic('topic-name')
await this.topic.create()

It was working fine before but started failing with DEADLINE_EXCEEDED error after we updated to the latest version 2.18.1.
We enabled gRPC debug mode and saw that all gRPC requests are sent with grpc-timeout header close to 5sec. After 5 seconds we get the error.

te: trailers
:path: /google.pubsub.v1.Publisher/CreateTopic
:method: POST
content-type: application/grpc
user-agent: grpc-node-js/1.3.6
:authority: pubsub.googleapis.com:443
accept-encoding: identity
grpc-accept-encoding: identity,deflate,gzip
authorization: 
x-goog-request-params: 
grpc-timeout: 4997m
x-goog-api-client: gax/2.25.0 gapic/2.18.1 gl-node/16.2.0 grpc/1.3.6 gccl/2.18.1

We checked with older version 2.8.0 and the grpc-timeout header is equal to 60 seconds. And topics were created fine. And it seems it also takes arount 5sec to create a topic. Looks like smth was changed between theses two version.

te: trailers
:path: /google.pubsub.v1.Publisher/CreateTopic
:method: POST
content-type: application/grpc
user-agent: grpc-node-js/1.2.9
:authority: pubsub.googleapis.com:443
accept-encoding: identity,gzip
grpc-accept-encoding: identity,deflate,gzip
grpc-timeout: 60000m
authorization: 
x-goog-request-params: 
x-goog-api-client: gax/2.10.3 gapic/2.10.0 gl-node/14.6.0 grpc/1.2.9 gccl/2.10.0

We tried to pass timeout attribute in topic.create method but it did not make any difference. Is there any way to increase/override the grpc-timeout value?

@product-auto-label product-auto-label bot added the api: pubsub Issues related to the googleapis/nodejs-pubsub API. label Oct 27, 2021
@meredithslota
Copy link
Contributor

It looks like this was recently changed as the Node.js client library had different default settings compared to the other languages, which made debugging difficult: #1399 is the relevant change. Let me tag in the author of that PR @feywind to see if there is a way to override this (I think there is but I am not certain).

@meredithslota meredithslota added the type: question Request for information or clarification. Not an issue. label Nov 2, 2021
@feywind
Copy link
Collaborator

feywind commented Nov 2, 2021

Yeah, we changed these defaults to be in line with some other services. Maybe @kamalaboulhosn can speak to the reasoning behind those changes? (Or if I did them incorrectly...)

In the meantime, I think you should be able to override them with something like this:

const opts = {
  interfaces: {
    "google.pubsub.v1.Publisher": {
      "retry_params": {
        "default": {
          "initial_rpc_timeout_millis": 60000,
        }
      }
    }
  }
};

const p = new PubSub({
  clientOptions: opts
});

When I try that, I get this from grpc-js:

		grpc-timeout: 59916m

@kamalaboulhosn
Copy link
Contributor

@feywind The intention was for the change to 5 seconds to only affected Publish calls, not CreateTopic calls. CreateTopic should have a deadline of 60s.

@feywind
Copy link
Collaborator

feywind commented Nov 3, 2021

Eep, thanks for the clarification. I'll see if I can move the change to just Publish.

@jcurlier
Copy link

jcurlier commented Nov 5, 2021

+1 same issue

@kthilagarajan
Copy link

Got the same issue.
Tried with 2.17.0, it worked.

@hbinduni
Copy link

Got the same issue. Tried with 2.17.0, it worked.

i have the same issue. downgrade to v2.17.0 solve my issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the googleapis/nodejs-pubsub API. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants