pubsub: move polling task to alarm executor#2079
pubsub: move polling task to alarm executor#2079pongad merged 3 commits intogoogleapis:masterfrom pongad:mv-exec
Conversation
"alarm executor". This commit moves polling tasks to the same executor, and give the said executor more threads to handle the extra workload. This commit puts all client's "house keeping" tasks in one executor, and all user code in another. In this way, long running user code cannot starve the client of CPU.
| FlowController flowController, | ||
| ScheduledExecutorService executor, | ||
| @Nullable ScheduledExecutorService alarmsExecutor, | ||
| ScheduledExecutorService alarmsExecutor, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| ApiClock clock) { | ||
| this.executor = executor; | ||
| this.alarmsExecutor = alarmsExecutor == null ? SHARED_ALARMS_EXECUTOR : alarmsExecutor; | ||
| this.alarmsExecutor = alarmsExecutor; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| @Nullable Long maxDesiredPulledMessages, | ||
| ScheduledExecutorService executor, | ||
| @Nullable ScheduledExecutorService alarmsExecutor, | ||
| ScheduledExecutorService alarmsExecutor, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| private static final Duration ACK_DEADLINE_UPDATE_PERIOD = Duration.ofMinutes(1); | ||
| private static final double PERCENTILE_FOR_ACK_DEADLINE_UPDATES = 99.9; | ||
|
|
||
| private static final ScheduledExecutorService SHARED_ALARMS_EXECUTOR = |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| ExecutorProvider executorProvider = DEFAULT_EXECUTOR_PROVIDER; | ||
| @Nullable ExecutorProvider alarmsExecutorProvider; | ||
| ExecutorProvider alarmsExecutorProvider = FixedExecutorProvider.create(SHARED_ALARMS_EXECUTOR); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@davidtorres PTAL |
🤖 I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
…e-plugin to v3.3.0 (#2079) * build(deps): update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.3.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
…e-plugin to v3.3.0 (#2079) * build(deps): update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.3.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
#2079) * chore: Update generation configuration at Mon Apr 21 22:11:35 UTC 2025 * Update hermetic_library_generation.yaml * Update generation_config.yaml * chore: generate libraries at Mon Apr 21 22:32:36 UTC 2025 * chore: Update generation configuration at Tue Apr 22 02:30:55 UTC 2025 * chore: update build.sh to use latest formatter * chore: use java 17 in samples check * chore: udpate clirr --------- Co-authored-by: Blake Li <[email protected]> Co-authored-by: Diego Marquez <[email protected]>
"alarm executor".
This commit moves polling tasks to the same executor,
and give the said executor more threads
to handle the extra workload.
This commit puts all client's "house keeping" tasks in one executor,
and all user code in another.
In this way, long running user code cannot starve the client of CPU.
cc @davidtorres