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

Cannot listen to more than 20 subscriptions? #1705

Open
daffron opened this issue Apr 4, 2023 · 6 comments
Open

Cannot listen to more than 20 subscriptions? #1705

daffron opened this issue Apr 4, 2023 · 6 comments
Assignees
Labels
api: pubsub Issues related to the googleapis/nodejs-pubsub API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.

Comments

@daffron
Copy link

daffron commented Apr 4, 2023

Thanks for stopping by to ask us a question! Please make sure to include:

  • What you're trying to do

Ive spent the last 2 days trial and error-ing a lot of parameters, but as soon as I listen to more than 20 subscriptions. I am no longer able to 'ack' any messages.

I am using Exactly Once Delivery and ackWithResponse() just hangs as soon as I start more than 20 listeners, I have rotated which subs these are and it seems purely the number of subs, not what they are.

Is there a config item Ive missed in GCP / Pubsub somewhere?

Thanks!

  • What code you've already tried

  • Any error messages you're getting
    No error messages or warnings about max event listeners or anything

Eventually if I wait 10 mins I will get the below error, this is 10 minutes after calling ackWithResponse() and hanging

      "type": "AckError",
      "message": "INVALID : Retried for too long",
      "stack":

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

@daffron daffron added priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue. labels Apr 4, 2023
@product-auto-label product-auto-label bot added the api: pubsub Issues related to the googleapis/nodejs-pubsub API. label Apr 4, 2023
@daffron
Copy link
Author

daffron commented Apr 4, 2023

I just found this, and changing the maxStreams to 3 have fixed it for me. However I will leave this open as the error that was reported back then is no longer being surfaced - making it hard to figure out!

#550

@feywind
Copy link
Collaborator

feywind commented Apr 4, 2023

@daffron Thanks for both the issue and the follow-up! I'm glad you found a workaround, but I'll want to look at this still.

@nguyen-vo
Copy link

nguyen-vo commented Apr 8, 2023

This could relate to a hard limit on PubSub clients where a client can only handle 100 streams. We have a service that subscribes to multiple subscriptions. And initially, we had that issue we opened a ticket with GCP support. So by default, all subscriptions share the same client and each subscription has 5 streams. So the workaround mentioned above might work for you but eventually, you will hit the hard limit again if you have more subscriptions. In our case, we compute the client that the service needs based on the number of subscriptions. we have 10 subscriptions per client which are 50 streams per client. However, we do not have Exactly Once Delivery feature enable, so I am not sure if this is applied to your use case.

You can refer to this document.
https://cloud.google.com/nodejs/docs/reference/pubsub/latest/pubsub/subscription#:~:text=By%20default%20each,each%20Subscription%20object.

@feywind
Copy link
Collaborator

feywind commented Apr 12, 2023

My understanding is that making many subscribers (not just streams, but different subscriptions) in one client is considered a bit of an anti-pattern, but it seems like it should still be able to either do it reliably, or at least notify you gracefully that it's not going to work.

@daffron
Copy link
Author

daffron commented Apr 13, 2023 via email

@feywind
Copy link
Collaborator

feywind commented Apr 18, 2024

@daffron We talked about this today at our status meeting, and the conclusion is that 20 subscribers in one client is not something we don't support, just that you may start running up against grpc limitations (it has a stream limit, and that would be shared within one client (PubSub object)). If you're still having troubles with this, you might try breaking it up into several clients with fewer streams.

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: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

3 participants