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

Load cpu 100% macOS #445

Closed
klerick opened this issue Jan 25, 2019 · 10 comments
Closed

Load cpu 100% macOS #445

klerick opened this issue Jan 25, 2019 · 10 comments
Assignees
Labels
api: pubsub Issues related to the googleapis/nodejs-pubsub API. priority: p2 Moderately-important priority. Fix may not be included in next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@klerick
Copy link

klerick commented Jan 25, 2019

Environment details

  • OS: MacOs Mojave
  • Node.js version: 8.12.0 and 10
  • npm version: 10.5.0 and 6.1.0
  • @google-cloud/pubsub version: 0.22.0 and 0.23.0

I am having a problem with a pubsub sdk.
I've tried to reproduced it on other pc and have got the same result.
If I try to run a subscribe script, I will get cpu loading on 100%
If i use linux, it will work ok.

const { PubSub } = require('@google-cloud/pubsub');
const pubsub = new PubSub({
  credentials: {}
});
const subscription = pubsub.subscription(topicName);
subscription.on(`message`, message => {
  console.log(`Received message ${message.id}:`);
  console.log(`\tData: ${message.data}`);
  console.log(`\tAttributes: ${message.attributes}`);
  messageCount += 1;
  message.ack();
});

Screen load cpu

@callmehiphop
Copy link
Contributor

Possible duplicate of #288

@callmehiphop callmehiphop added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jan 25, 2019
@callmehiphop
Copy link
Contributor

Hi @klerick I'm having a bit of trouble reproducing this, could you provide me with a little bit more info?

  • Are you using GCLOUD_PROJECT env var?
  • Are you using default application credentials?
  • Roughly how many messages are pending before creating a subscription?

@klerick
Copy link
Author

klerick commented Jan 25, 2019

I've tried to use GOOGLE_APPLICATION_CREDENTIALS env var, and everything works fine. But if I create PubSub object using params. A, then I get load 100% cpu and I do not get any error message.

@callmehiphop
Copy link
Contributor

@klerick I just made a release (0.24.0) that should resolve the issue you're seeing. If you continue to encounter this issue, please let us know! Thanks again for the report!

@klerick
Copy link
Author

klerick commented Jan 30, 2019

@callmehiphop I've checked a new version. As I see the problem is still there

@callmehiphop callmehiphop reopened this Jan 30, 2019
@JustinBeckwith
Copy link
Contributor

@callmehiphop let me know if you want to talk about caching the promise on GoogleAuth.getClient.

@callmehiphop
Copy link
Contributor

@JustinBeckwith I'd love to!

@callmehiphop
Copy link
Contributor

callmehiphop commented Jan 31, 2019

@klerick I made a branch with a possible fix, would you be willing to test it out for me?

@callmehiphop callmehiphop self-assigned this Feb 1, 2019
@callmehiphop
Copy link
Contributor

So I think I've narrowed this down to an auth issue (googleapis/google-auth-library-nodejs#614), although I'm waiting on a response of some kind, I think the fix for this will be small and hopefully coming soon.

@callmehiphop
Copy link
Contributor

@klerick good news, I think this has been fixed in the latest google-auth release. Its a minor change so we won't be releasing a new version of PubSub, but you might need to reinstall to pick up the latest auth changes.

I'm going to close this (again), but if your issue persists please let me know! Thanks again!

@google-cloud-label-sync google-cloud-label-sync bot added the api: pubsub Issues related to the googleapis/nodejs-pubsub API. label Jan 31, 2020
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Apr 6, 2020
feywind pushed a commit to feywind/nodejs-pubsub that referenced this issue Nov 12, 2024
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. priority: p2 Moderately-important priority. Fix may not be included in next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

4 participants