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

Allow custom systemExecutorProvider to be specified via configuration for subscribers #703

Open
krjura opened this issue Sep 8, 2022 · 0 comments
Assignees

Comments

@krjura
Copy link

krjura commented Sep 8, 2022

Feature description

Today I was debugging very high thread usage of one of my applications.

In the thread dump I noticed a lot of threads called "Subscriber-SE-<x>-<y>".
These threads are created by "com.google.cloud.pubsub.v1.Subscriber" in the build() method.

It seems that if the systemExecutorProvider is not set in the subscriber, a new ScheduledExecutorService will be created with a minimum of 6 threads (or more based on parallelPullCount). This is done for every subscriber.

In my case these threads where mostly waiting and not doing anything.

Looking at https://github.com/micronaut-projects/micronaut-gcp/blob/master/gcp-pubsub/src/main/java/io/micronaut/gcp/pubsub/bind/DefaultSubscriberFactory.java#L78 micronaut is setting ExecutorProvider but not the SystemExecutorProvider.

It is possible to add a new configuration property in gcp.pubsub.subscriber.* namespace (for example gcp.pubsub.subscriber.*.system-executor) that will allow configuration of a shared system executor?

@krjura krjura changed the title allow custom systemExecutorProvider to be specified via configuration for subscribers Allow custom systemExecutorProvider to be specified via configuration for subscribers Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants