AAP-14329: Add configurable virtual thread executor to gRPC service framework - #154
Merged
Merged
Conversation
| @Builder.Default int maxRstPerMinute = 500; | ||
| @Builder.Default Duration maxConnectionAge = Duration.ZERO; | ||
| @Builder.Default Duration maxConnectionAgeGrace = Duration.ZERO; | ||
| @Builder.Default ExecutorType executorType = ExecutorType.PLATFORM; |
Contributor
There was a problem hiding this comment.
Enum doesn't feel very extensible. Why not just take an executor, callers can opt in to whatever executor they want, virtual threads or otherwise.
Contributor
Author
There was a problem hiding this comment.
Makes sense, I'll refactor to accept an optional Executor directly. My original thinking was to centralize the reflection boilerplate (needed because of our Java 11 source constraint) + JDK < 21 fallback so every service opting into VTs doesn't reimplement the same pattern. But an open Executor field is more flexible and the duplication is minimal. Will update.
aaron-steinfeld
approved these changes
Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Executorfield toGrpcPlatformServerDefinition(defaults tonull— gRPC uses its own default executor)ServerBuilder.executor()Motivation
EDS hits OOMKills at 500 RPS when AI SecRules are enabled because the bounded platform thread pool saturates during blocking gRPC fan-out. Virtual threads eliminate this bottleneck by decoupling concurrency from OS thread count — each blocking call yields its carrier thread instead of holding it.
This change lets EDS (and any future service) pass a virtual thread executor without the framework needing to know about VT specifics.
Changes
GrpcPlatformServerDefinition.javaExecutor executor(defaultnull)GrpcPlatformServiceContainer.javaServerBuilderwhen non-nullRollback
Not setting the
executorfield (default) preserves existing behavior — gRPC uses its own internal executor. Zero change for any service that doesn't opt in.Test plan
executoris unset)executorType: virtual→platform) provides instant rollback in production