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

Set number of threads for async executor provider as a system property #2631

Closed
olavloite opened this issue Sep 18, 2023 · 0 comments · Fixed by #2632 or #2648
Closed

Set number of threads for async executor provider as a system property #2631

olavloite opened this issue Sep 18, 2023 · 0 comments · Fixed by #2632 or #2648
Assignees
Labels
api: spanner Issues related to the googleapis/java-spanner API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@olavloite
Copy link
Collaborator

The ExecutorProvider that is used for the Async API in the client library can be set using the SpannerOptions$Builder#setAsyncExecutorProvider method. This makes it possible for direct users of the Async API to determine the type of executor and the number of threads to use. This configuration is however not accessible to anyone using an abstraction on top of the client library, such as the Spanner R2DBC driver, unless that abstraction has also added support for this configuration property to their own API.

When no ExecutorProvider has been set, the Java client library will use a default 8-thread Executor. The '8 threads' is currently hard-coded. We should change this hard-coded value into one that can be set with a system property, so users of both the client library and any driver that builds on top of it can set a different default.

@olavloite olavloite added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Sep 18, 2023
@olavloite olavloite self-assigned this Sep 18, 2023
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/java-spanner API. label Sep 18, 2023
olavloite added a commit that referenced this issue Sep 18, 2023
Add support for setting the core pool size for the thread pool that is
used for the Async API using a system property. This allows users to
change this property without having to change code, and to set the
property if they are using a framework that builds on top of the client
library, but that does not have a configuration option for setting a
custom executor provider.

Fixes #2631
gcf-merge-on-green bot pushed a commit that referenced this issue Oct 4, 2023
…#2632)

Add support for setting the core pool size for the thread pool that is used for the Async API using a system property. This allows users to change this property without having to change code, and to set the property if they are using a framework that builds on top of the client library, but that does not have a configuration option for setting a custom executor provider.

Fixes #2631
surbhigarg92 pushed a commit to surbhigarg92/java-spanner that referenced this issue Oct 5, 2023
…googleapis#2632)

Add support for setting the core pool size for the thread pool that is used for the Async API using a system property. This allows users to change this property without having to change code, and to set the property if they are using a framework that builds on top of the client library, but that does not have a configuration option for setting a custom executor provider.

Fixes googleapis#2631
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
1 participant