Skip to content

catch Exceptions in pubsub #68

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

Closed
stephenplusplus opened this issue Aug 11, 2016 · 6 comments
Closed

catch Exceptions in pubsub #68

stephenplusplus opened this issue Aug 11, 2016 · 6 comments
Labels
🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@stephenplusplus
Copy link

From @mytholog on August 3, 2016 8:37

Environment details

  • OS: Mac (Capitan)
  • Node.js version: 4.4.7
  • gcloud-node version: 0.37.0

Steps to reproduce

  1. require gcloud-node
  2. run code from https://github.com/GoogleCloudPlatform/nodejs-getting-started/tree/master/6-pubsub
"stack":[
  "Error: Deadline Exceeded",
  " at Function.GrpcService.decorateError_ (/node_modules/gcloud/lib/common/grpc-service.js:482:34)",
  " at Object.callback (/node_modules/gcloud/lib/common/grpc-service.js:247:35)",
  " at /node_modules/gcloud/node_modules/grpc/src/node/src/client.js:420:14"
],
"level":"error",
"message":"uncaughtException: Deadline Exceeded"

Copied from original issue: googleapis/google-cloud-node#1465

@ace-n
Copy link
Contributor

ace-n commented Oct 13, 2016

To what degree should we be catching exceptions?

Personally, I'd err on the side of not catching them unless they are not exceptional. If the sample halts and catches fire due to a truly exceptional (i.e. problematic) event, perhaps we could display a slightly better message to the user (along the lines of "Oh no, something went wrong!") - but we'd still have to give them the stack trace/exception type so they/we can debug it.

@jmdobry thoughts?

@jmdobry
Copy link
Member

jmdobry commented Oct 13, 2016

Is this reproducible with the latest @google-cloud/pubsub?

@ace-n
Copy link
Contributor

ace-n commented Oct 14, 2016

@jmdobry Not from what I've seen on my machine (everything works fine) - that being said, this seems like a nondeterministic error.

@stephenplusplus @mytholog Can you clarify whether the intent of this issue was:

  1. We should fix this particular error
  2. We should catch errors within the getting started samples (what I thought your point was initially)
  3. Something else entirely

@stephenplusplus
Copy link
Author

Deferring to @mytholog.

@mytholog
Copy link

mytholog commented Oct 15, 2016

"@google-cloud/pubsub": "^0.3.0"

reproduced on the third or more launch

{
    "message": "Deadline Exceeded",
    "stack": "Error: Deadline Exceeded\n    at /tmp/cl/node_modules/grpc/src/node/src/client.js:417:17",
    "code": 504,
    "metadata": {
      "_internal_repr": {}
    },
    "level": "error"
  }
  {
    "date": "Sat Oct 15 2016 10:19:56 GMT+0700 (+07)",
    "process": {
      "pid": 28741,
      "uid": 501,
      "gid": 20,
      "cwd": "/tmp/cl",
      "execPath": "/usr/local/Cellar/node/6.8.0/bin/node",
      "version": "v6.8.0",
      "argv": [
        "/usr/local/Cellar/node/6.8.0/bin/node",
        "/tmp/cl/worker.js"
      ],
      "memoryUsage": {
        "rss": 84951040,
        "heapTotal": 70103040,
        "heapUsed": 46127008
      }
    },
    "os": {
      "loadavg": [
        2.34619140625,
        1.7861328125,
        1.578125
      ],
      "uptime": 180497
    },
    "trace": [
      {
        "column": 17,
        "file": "/tmp/cl/node_modules/grpc/src/node/src/client.js",
        "function": null,
        "line": 417,
        "method": null,
        "native": false
      }
    ],
    "stack": [
      "Error: Deadline Exceeded",
      "    at /tmp/cl/node_modules/grpc/src/node/src/client.js:417:17"
    ],
    "level": "error",
    "message": "uncaughtException: Deadline Exceeded"
  }
  {
    "error": {
      "code": 504,
      "metadata": {
        "_internal_repr": {}
      }
    },
    "currentJobMessage": null,
    "level": "error",
    "message": "uncaughtException in worker"
  }

@ace-n
Copy link
Contributor

ace-n commented Oct 19, 2016

@mytholog Which region does your project use? If you're using a region that is geographically far away from you, that may contribute to timeout issues. (e.g. europe-west1 may be better for someone in Russia than a us-based region.)

Also, I'm assuming your issue revolves around this error specifically. If your argument is that exception handling needs to be improved, please let us know so we can steer things in that direction.

@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

5 participants