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

feat: support setting an async executor provider #1263

Merged
merged 2 commits into from Jun 30, 2021
Merged

feat: support setting an async executor provider #1263

merged 2 commits into from Jun 30, 2021

Conversation

olavloite
Copy link
Contributor

@olavloite olavloite commented Jun 29, 2021

The Spanner Async API uses an ExecutorProvider for producing rows for an AsyncResultSet. The default that is automatically created is fine for most use cases, but did not allow users to override the default settings that are:

  • a pool containing at most 8 threads
  • threads automatically time out after 1 minute if they are not used

This PR adds the possibility for users to supply their own ExecutorProvider to use with the async API.

Fixes #1262

@olavloite olavloite requested a review from thiagotnunes Jun 29, 2021
@olavloite olavloite requested a review from as a code owner Jun 29, 2021
@product-auto-label product-auto-label bot added the api: spanner label Jun 29, 2021
@google-cla google-cla bot added the cla: yes label Jun 29, 2021
Copy link
Contributor

@thiagotnunes thiagotnunes left a comment

Do you know if there are any metrics available for the thread pool? I think we should expose thread pool usage in cloud monitoring for the default executor.

@olavloite
Copy link
Contributor Author

@olavloite olavloite commented Jun 30, 2021

Do you know if there are any metrics available for the thread pool? I think we should expose thread pool usage in cloud monitoring for the default executor.

The standard executor services in Java do not expose any metrics, so we would need to add that ourselves (or add some open source library, there are a couple that do this). I'll add a feature request for it to the repository.

@olavloite olavloite merged commit 369c8a7 into master Jun 30, 2021
17 checks passed
@olavloite olavloite deleted the issue-1262 branch Jun 30, 2021
Copy link

@pravsingh pravsingh left a comment

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants